Professional Documents
Culture Documents
Table of Content
Overcoming Cross-Compatibility Obstacles
Setup
For Android
For iOS
An Improved Process
5
6
7
10
Platform-specific approach make platform specific tools for the localization process available
to you for example like the integrated XLIFF export of Xcode.
However, if both apps offer the same functionality and display pretty much the same content
you can really benefit from shared translation data.
Sharing translation data between an iOS and an Android app leads to new challenges that I will
address in this blog post.
I will sketch out how to share translations across both platforms as well as how to setup a
continuous localization workflow for this.
These cryptic segment names lose any contextual information and are not helpful to
translators.
Imagine using such a segment identifier in a shared setup with an Android app. Your Android
team would have a really hard time finding out where this segment should actually be located
inside their application because it lacks any information on its context. It even gets worse if the
copy is quite short or used in multiple locations with the segment name offering no help at all.
In general, developers on both platforms will benefit from well structured and meaningful key
names.
You should abandon the thought of using Base internationalization in Xcode when you intend
to share your translations between both apps. At least if you want to keep your whole team
happy.
iOS and Android rely on different formats and structures for their localization files. Even if you
have generated a nice String file for your iOS app that contains meaningful key names, you
cant just include that file in your Android app or vice versa.
Before adding an existing iOS locale file to an Android app, you need to convert your
localization files between the iOS Localizable Strings and Android XML format.
PhraseApp also offers an Xcode and an Android studio plugin (Beta) to allow simple
synchronization with our online Translation Center.
After setting up your account and initial project, the next step is to download and install the
PhraseApp plugins for Xcode (iOS) and Android Studio. Like described in the previous section,
we wont use the Base Internationalization feature workflow in Xcode (Note that the guide for
the Xcode plugin relies on the Base Internationalization feature using the XLIFF format).
If you have followed the plugin installation guides, you should now have one .phraseapp.yml
configuration file inside your iOS apps folder and one inside the Android app. At PhraseApp we
call the upload of locale files p ush and the export or download p ull. Youre now basically ready
to push and pull your translations using the plugin or the PhraseApp Client directly for each
specific platform. However, since we want to enable a workflow to share translations between
iOS and Android there is one necessary step left. We need to customize the .phraseapp.yml a bit
for each app, so let me show you how in the next step.
There is a format option convert_placeholder which we need to activate for the
pull-command as shown in this example configuration file:
For Android:
1
phraseapp:
access_token: 930dfe3c2736d745c610c46b3d050b5526a45fcs5d01d007e5103a481f9a40cs
file_format: xml
project_id: 3dbc6dc4d79eaa48a7af7ebc7ea12ef5
pull:
targets:
- file: ./app/src/main/res/values/strings.xml
params:
locale_id: 17326bf9e3eb422fe1a33bb2faas7af1
10
11
12
13
locale_id: 273dxbf9e3eb422fe1a33bb2fad87af1
14
15
16
- file: ./app/src/main/res/values-fr-rCA/strings.xml
params:
17
locale_id: 37326bf9e3eb422fe1a33bb2fad87aas
18
19
20
21
push:
sources:
22
- file: ./app/src/main/res/values/strings.xml
23
For iOS:
1
phraseapp:
access_token: 930dfe3c2736d745c610c46b3d050b5526a45fcs5d01d007e5103a481f9a40cs
project_id: 3dbc6dc4d79eaa48a7af7ebc7ea12ef5
file_format: strings
pull:
targets:
- file: ./en.lproj/Localizable.strings
params:
locale_id: 17326bf9e3eb422fe1a33bb2faas7af1
10
11
12
13
- file: ./es.lproj/Localizable.strings
params:
14
locale_id: 273dxbf9e3eb422fe1a33bb2fad87af1
15
16
17
18
- file: ./fr-CA.lproj/Localizable.strings
params:
19
locale_id: 37326bf9e3eb422fe1a33bb2fad87aas
20
21
22
push:
23
sources:
24
- file: ./en.lproj/Localizable.strings
25
I assume in the provided example configuration files that you want to translate your apps from
English (en) to Spanish (es) and to Canadian French (fr-CA). Therefore, we have created the
according locales inside our PhraseApp project before hand.
Check out the PhraseApp client configuration documentation for more details on possible
options.
Its time for your first upload! Use the plugins or the PhraseApp Client from the command line
to push your locale files from one of your projects to PhraseApp. You will notice that only one
locale will be uploaded as shown in this example output of the Android Studio plugin:
In the example configuration file, I have explicitly added only one push-source for the original
copy (also called default locale within our system). I highly recommend to not push all locales
in your continuous workflow. Its a good idea to manage all copy and translation changes
within PhraseApp from now on and to use push only to introduce additional translation
segments.
If you have existing translations for any other locale, you can of course still initially push them
using the PhraseApp client or uploading them inside the using the Translation Center.
Now, your translators can start editing or adding translation copy inside PhraseApp. If you
should need professional translations services, you can even order professional translations
through our software that are usually delivered within a couple of hours.
Whenever translations are updated you can use the PhraseApp plugin to pull those copy
changes into your two applications. You can also integrate this as a build or release step. As an
example you can simply add a hook to update your locales when building your iOS app in
Xcode. Just add a run script in your build phases of your chosen target that executes
phraseapp pull.
If you add new features that require completely new translation copy, you can just add the
required keys to the source locale file. Using the push command of the plugin, the newly created
segments will be uploaded to PhraseApp. The new segments will be created and are available
for translators in the Translation Center immediately.
An Improved Process
Congratulations, with this simple setup you have now enabled a continuous
internationalization workflow that ensures that your iOS and Android app will always share the
same set of translations.
Your Android and iOS apps are now prepared to use shared translation data. Updating the
apps copy is as easy as pulling the updated locale file from PhraseApp. Your localization team
can finally work on copy without having to bother your engineers too much. Similarly, your
engineers do not have to worry about the translation process and can spend their time on
developing the software.
phraseapp.com
sales@phraseapp.com
+49-40-357-187-76
Groe Theaterstrae 39
Hamburg, Germany