Localization for Lockwise iOS
The localization process for iOS is a bit of a trip:
- Create and update a l10n repository that will collect all the strings for all the locales
- Export strings from the app repository into that l10n repository
- Expose the strings from the l10n repository to the Pontoon tool for translation
- Import the string changes from the l10n repository back into the app repository
(1) Bootstrap locales
- From the lockwiseios-l10n repository
- Copy the templates folder to the locale(s) to add or "bootstrap" (ex:
cp -R templates en-US
) - Run
update-xliff.py
to fix the target language in the file(s) - Create a PR to merge to the
master
branch, this will make it available for translating
(2) Exporting Strings
- Fork of lockwiseios-l10n to make PRs from
- Clone the ios-l10n-scripts repo so it is a sibling of lockwise-ios.
cd lockwise-ios
../ios-l10n-scripts/export-locales-lockwise.sh
git remote add <your username> git@github.com:<your username>/lockwiseios-l10n.git
git push <your username> <branch name>
The script automatically creates the branch for you. You just need to grab its name to push in this step.- Create a PR of your l10n changes and submit it
(3) Pontoon
Magic happens in Step 3. Learn more here:
https://mozilla-l10n.github.io/documentation/tools/pontoon/
(4) Importing Strings
This assumes you have set up the lockwiseios-l10n repo as a sibling of lockwise-ios, see export above
cd lockwise-ios
../ios-l10n-scripts/import-locales-lockwise.sh
- Verify that new language files are created for the main app, credential provider extension, storyboards, and xibs. Note that if only there is no translation a new file won't be created.