Example project integrating this in the Xcode build process can be found here i18n-swift-example
To install the kuma-i18n-strings cli command globally, you can run the following command:
$ npm install -g kuma-i18n-strings
This is a 2-legged oauth method and designed to be "an account that belongs to your application instead of to an individual end user". Use this for an app that needs to access a set of documents that you have full access to. (read more)
For more information about setting up a Service Account look at the google-spreadsheet npm package
Multiple values are possible for the column names where the values can be found. This way you can use the translation file for multiple platforms. The array should contain the column names sorted by importance. If there is no value found in the first column it will fall back to the next and so on ...
In the column names for the values you can specify the language by adding
$$LANG$$ this will be replaced by the actual language. For example:
ios fallback $$LANG$$ will become
ios fallback en.
Currently only endpoints returning strings files are supported.
To collect all the strings from the storyboard, swift files:
$ kuma-i18n-strings collect
To sync the translations with an online datastore (for now only google spreadsheets):
$ kuma-i18n-strings sync
-s, --source Specify the path where the Xcode files are located-c, --config Specify the path to the kuma-i18n configuration file relative to the source path, default .kuma-i18n-strings-u, --update-files Specify if it may update the Localizable files, default false-h, --help Display help-v, --version Display the current version number
When you are using the above commands without
--update-files it will exit with an exit code of -1 when there are new translations in the online datastore or in the xcode project. This way you can integrate it within your build phases so that building fails when the translations aren't up-to-date.