Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G Guides
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ios-general
  • Guides
  • Wiki
  • shared localization

shared localization · Changes

Page history
Update shared localization authored Jul 21, 2017 by Darina's avatar Darina
Show whitespace changes
Inline Side-by-side
Showing with 16 additions and 12 deletions
+16 -12
  • shared-localization.md shared-localization.md +16 -12
  • No files found.
shared-localization.md
View page @ 08a0a58f
...@@ -16,20 +16,19 @@ npm -v ...@@ -16,20 +16,19 @@ npm -v
If it's not installed, go to https://nodejs.org/en/download/ and do it. If it's not installed, go to https://nodejs.org/en/download/ and do it.
**3. Install localization plugin** **3. Create main directory and install localization plugin**
- `mkdir UpdateLocalization`
Go to https://github.com/xavierha/localize-with-spreadsheet and download the repository. Run - `cd UpdateLocalization`
- `git clone https://github.com/xavierha/localize-with-spreadsheet.git`
``` - `cd localize-with-spreadsheet`
npm install localize-with-spreadsheet - `npm install`
```
if it fails, open `package.json` and change name to anything else, e.g. `"name": "localize-with-spreadsheet-test"`
**4. Create update localization script** **4. Create update localization script**
In the same folder create `update-localization.js` file. The example content: - `cd ..`
- `touch update-localization.js`
Write to `update-localization.js`. The example content:
``` ```
var Localize = require("localize-with-spreadsheet"); var Localize = require("localize-with-spreadsheet");
var transformer = Localize.fromGoogleSpreadsheet("GOOGLE_DOC_ID", '*'); var transformer = Localize.fromGoogleSpreadsheet("GOOGLE_DOC_ID", '*');
...@@ -39,11 +38,16 @@ transformer.save("PROJECT_FOLDER/Resources/Base.lproj/Localizable.strings", { va ...@@ -39,11 +38,16 @@ transformer.save("PROJECT_FOLDER/Resources/Base.lproj/Localizable.strings", { va
transformer.save("PROJECT_FOLDER/Resources/ru.lproj/Localizable.strings", { valueCol: "RU", format: "ios" }); transformer.save("PROJECT_FOLDER/Resources/ru.lproj/Localizable.strings", { valueCol: "RU", format: "ios" });
``` ```
Replace `GOOGLE_DOC_ID` with the actual google doc ID. it can be found in doc's URL. `KEY` is the column to be used for keys. Replace `PROJECT_FOLDER` with your project's folder real name. Add appropriate languages and paths. Replace `GOOGLE_DOC_ID` with the actual google doc ID. it can be found in doc's URL:
_docs.google.com/spreadsheets/d/_ `1n0ITsW53GZDfYZ0wz4ZOU1wJBzZQG4mHtPTjmmQM6_U `_/edit#gid=0_
`KEY` is the column to be used for keys.
Replace `PROJECT_FOLDER` with your project's folder real name. Add appropriate languages and paths.
**5. Add it to the project** **5. Add it to the project**
Firstly, remove everything from the plugin folder, except of `node_modules` and `update-localization.js`. Then add this folder to the project's root as a folder (not category), so it is added as a blue folder (not yellow). Also, don't associate it with any target, so these files don't get into final application: Firstly, remove everything from the `UpdateLocalization`, except of `node_modules`, `core` and `update-localization.js`. Then add `UpdateLocalization` folder to the project's root as a folder (not category), so it is added as a blue folder (not yellow). Also, don't associate it with any target, so these files don't get into final application:
![Screen_Shot_2017-06-19_at_16.50.45](/uploads/fcd05773e6eb458c8cfe2516e52008d4/Screen_Shot_2017-06-19_at_16.50.45.png) ![Screen_Shot_2017-06-19_at_16.50.45](/uploads/fcd05773e6eb458c8cfe2516e52008d4/Screen_Shot_2017-06-19_at_16.50.45.png)
......
Clone repository
  • Swift Code Style
  • automated slack builds
  • continuous integration
  • Home
  • jenkins auto build
  • shared localization
  • versioning rules