https://github.com/xvrh/localize-with-spreadsheet
Create a localization file in Android or iOS format from a Google Spreadsheet
https://github.com/xvrh/localize-with-spreadsheet
Last synced: 3 months ago
JSON representation
Create a localization file in Android or iOS format from a Google Spreadsheet
- Host: GitHub
- URL: https://github.com/xvrh/localize-with-spreadsheet
- Owner: xvrh
- Created: 2013-03-21T10:39:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-08-20T09:25:25.000Z (about 4 years ago)
- Last Synced: 2025-07-11T20:03:48.633Z (3 months ago)
- Language: JavaScript
- Size: 2.02 MB
- Stars: 127
- Watchers: 7
- Forks: 80
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert a Google Spreadsheet to a localization file
## Installation
npm install localize-with-spreadsheet## Example
Given a Google Spreadsheet like this:
The tool fetch the spreadsheet and write the result to a file in the Android or iOS format:
 
Create a file update-localization.js
var Localize = require("localize-with-spreadsheet");
var transformer = Localize.fromGoogleSpreadsheet("0Aq6WlQdq71FydDZlaWdmMEUtc2tUb1k2cHRBS2hzd2c", '*');
transformer.setKeyCol('KEY');transformer.save("values/strings.xml", { valueCol: "NL", format: "android" });
transformer.save("values-fr/strings.xml", { valueCol: "FR", format: "android" });transformer.save("nl.lproj/Localizable.strings", { valueCol: "NL", format: "ios" });
transformer.save("fr.lproj/Localizable.strings", { valueCol: "FR", format: "ios" });Run it with
node update-localization.js
## Advanced
You can filter the worksheets to include with the second parameter of 'fromGoogleSpreadsheet'
Ex:Localize.fromGoogleSpreadsheet("", '*');
Localize.fromGoogleSpreadsheet("", ['HomeScreen, 'ContactScreen']);
Localize.fromGoogleSpreadsheet("", [0, 2]);## Notes
- The script will preserve everything that is above the tags: < !-- AUTO-GENERATED --> or // AUTO-GENERATED
- Your spreadsheet should be "Published" for this to work
- You need to have git installed for the installation