Localizing your Android app can boost sales, increase conversion rates, and improve the overall user experience for your app. This tutorial will guide you through the process of creating a multilingual Android app with Android Studio. Shall we start?
Android Studio is the official Android IDE being developed by Google.
If this is your first Android Studio project: simply install Android Studio, create a new project from the “Blank Activity” template and drag some UI widgets to the blank canvas space. We used this little example view (to the right) that we will be using for this post.
By default, UI widgets store their label in hard-coded strings. If you hover your cursor over a UI widget, Android Studio shows a tooltip that offers to move this hard-coded string to a resource file named strings.xml.
Go ahead, follow the tooltip and move all your translatable strings to the strings.xml resource file.
Translating With The Android Studio Translation Editor
In your projects file navigator, expand the newly created values directory, right-click the strings.xml file to open the Translation Editor.
In the Translation Editor, click the globe-icon to add a new language file, in our example we will add ‘de’ (German) and ‘es”(Spanish).
You may need to close and re-open the Translation Editor tab after adding a new language if it does not show up immediately.
You can now start translating your strings. If a string is not translated in a locale, the app will automatically fall back to the value in the default strings.xml – usually the English language file will be used as a default language.
With an elaborate copywriting process you might want to separate the developer locale used for development (maybe containing placeholder copy) and the English, edited and proof-read language version.
And voila: you’re done! There is no extra code for language selection needed. Android will select the right locale based on the device language if it is available in your published application.
Getting Professional Translation And Sharing String Files With Translators
If you want to take localization one step further, check out Phrase, a service that helps you manage your translation process online. You can even order professional translations with the click of a button.
The Phrase Android Studio Plugin integrates seamlessly with Android Studio and the Translation Editor. Install the Plugin, then navigate to File -> Settings -> IDE Settings -> Phrase and enter the Auth Token for your project. On the main menu bar, you can now push and pull locales from Phrase.
Be sure to subscribe and receive all updates from the Phrase blog straight to your inbox. You’ll receive localization best practices, about cultural aspects of breaking into new markets, guides and tutorials for optimizing software translation and other industry insights and information. Don’t miss out!