icapps Translations
Import the translations from the icapps translations portal.
Installation
Add this line to your application's Gemfile:
gem 'icapps-translations'
And then execute:
$ bundle
Or install it yourself as:
$ gem install icapps-translations
Usage
-
translations init
: Run from your project root in order to setup the translations configuration. -
translations import
: Run from your project root in order to import the translations into the matching .strings files.
You can pass the --verbose
parameter to both commands in order to get more detailed information on what is happening.
Xcode
The 'translations' gem currently supports the following folder structure for iOS:
*/en.lproj/Localizable.strings
In this case the language's short name is 'en' and the filename in the configuration is set to 'Localizable.strings'. The en.lproj folder can be nested inside other folders.
Android
We currently check if the folder has an android project by looking for .gradle
files. So this is currently the only supported way for Android.
The 'translations' gem currently supports the following folder structure for Android:
app/src/main/res/values-en/strings.xml
In this case the language's short name is 'en' and the filename in the configuration is set to 'strings.xml'. It's important that this structure is available as defined above. This is currently not configurable.
When you have a default_language
set to 'en' in your configuration file the values-en
will be values
instead.
React Native
We currently check if the folder has an react project by looking for package.json
files.
The 'translations' gem currently supports the following folder structure for React:
labels/en.json
In this case the language's short name is 'en' and the filename in the configuration is set to 'en.json'. It's important that this structure is available as defined above. This is currently not configurable.
Build gem
Start by updating the version number in the lib/icapps/translations/version.rb
file.
Then build the gem by running the following commands:
rake build
rake release
Contributing
- Fork it ( https://github.com/icapps/translations/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Run
rubycop
in order to be compliant to our coding style. - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request