syncstrings
v1.1.0
Published
Sync your Localizable.strings with Google Spreadsheets
Downloads
4
Readme
syncstrings
Managing Localizable.strings
files sucks. Translating them with a team sucks. This tool syncs your local .strings
files with a Google Spreadsheet to allow easy collaboration on your localization.
Installation
sudo npm install -g syncstrings
Usage
syncstrings -c [path to config file]
What does the tool do?
- Load your configuration
- Connect to the configured spreadsheet and load all definded strings
- Load the local
.strings
file and overwrite all strings with the corresponding strings from the spreadsheet - Upload all new keys to the spreadsheet
- Save your local
.strings
file
How should the config look like?
{
"google": {
"spreadsheetId": "spreadsheet id",
"worksheetName": "Translation",
"username": "[email protected]",
"password": "hihihi"
},
"translation": {
"basePath": "path/to/project/directory",
"startRow": "2",
"keyRow": "1",
"commentRow": "2",
"languages": {
"Base": "3"
}
}
}
| Name | Description |
|------------|--------------------------------------------------------------------------|
| google.spreadsheetId
| the ID of the spreadsheet. Look in your browsers address bar |
| google.worksheetName
| the title of the worksheet to use |
| translation.basePath
| path to the directory that contains the "language".lproj files |
| translation.startRow
| Importing will start at this row. 1-based. Start at 2 to leave room for a headline |
| translation.keyRow
| Column to put the keys in (yeah, it should be called keyColumn) |
| translation.commentRow
| Column to put the comments (currently not supported) |
| translation.languages
| Object containing "Name of language" => "number of column to put stuff in" |
How should the spreadsheet look like?
How should I update my local strings file after adding new keys to my source?
This sucks. But fortunately there is a REALLY nice tool to do the job. Just buy LocalizableStringsMerge and stay happy.
(But you'll need to remove the `/* NEW */ flags it creates prior to syncing the strings)
Known bugs
This is a quickly developed script which works for me, but I think it could be useful for others. Theoretically it should support multiple languages, but this is currently untested.
Licence
MIT