In the past we made good experiences with PhraseApp for our Symfony2 app (see this post). So we decided to try it for iOS development. As it turned out it works like a charm with iOS Localizable Strings as well.
Our Workflow
- Engineers add new translations keys to the code1NSLocalizedString(@"ACMELoginButton", @"Login button title")
We run a script that uses to generate the strings from the source code - We push the new strings as Base locale to PhraseApp
- The translators get notified about the new strings and can translate them in the PhraseApp backend
- We pull the translated strings from PhraseApp and all new translation keys are translated
Step-By-Step Tutorial
- Sign up at PhraseApp, create your project and remember your auth token
- Install the phrase gem1gem install phrase
Go to your project dir and init phrase1<span style="font-size: 12.8px; line-height: 1.5;">phrase init --secret=YOUR_AUTH_CODE</span> - Push your existing Localizable.strings files to PhraseApp to automatically create the languages
- 123phrase push Resources/Localizations/Base.lproj/Localizable.stringsphrase push Resources/Localizations/en.lproj/Localizable.stringsphrase push Resources/Localizations/de.lproj/Localizable.strings
- Create a small script (e.g.
Resources/Scripts/UpdateTranslations.sh
) that generates strings for your new translation keys from source, pushes them to PhraseApp and pulls back the translated strings1234567#!/bin/shlocalizationsPath="Resources/Localizations/"find ./ -name "*.m" -print0 | xargs -0 genstrings -o ${localizationsPath}Base.lprojphrase push ${localizationsPath}Base.lproj/Localizable.stringsphrase pull --target=${localizationsPath} --format=strings - Set the script to be executable1chmod +x Resources/Scripts/UpdateTranslations.sh
Whenever you want to update your translation keys, run the script - 1./Resources/Scripts/UpdateTranslations.sh
Done
Also published on Medium.
Comments