
Machine translation
Software localization
Android localization is a complex endeavor that requires discipline and respect for many rules and best practices. If you want to achieve high-quality results, a thorough translation and localization process is a must. Let’s take a look at five major pitfalls to watch out for when translating and localizing your Android application.
Images and videos are an essential part of an app. Leaving resources only in one language means that the users of your application will have a hard time fully understanding your app. In some cases, it might even offend or confuse users.
The most important thing to understand is that visuals are as much important as text. For example, Arabic and Hebrew have right-to-left (RTL) reading and writing direction so you would need to consider flipping the images in your app as well.
Apart from that, the most typical candidates for resource localization are:
Ideally, the user should not question the origin of your software product. They should observe the same local experience that they get for other applications in their market; correct visual appearance contributes greatly to it.
To get localization done properly, there are two crucial steps developers need to take:
All resources on Android should be stored in a separate resource folder. For example, the default folder for your resources is "values". When you create a separate translation for German or Spanish, those folders should be named "values-de" and "values-es". Use this convention to append language identifiers to all necessary languages.
[caption id="attachment_5984" align="aligncenter" width="524"]
As mentioned above, there is a separate strings.xml file appearing for each localized “values” folder. Using strings.xml is not just good practice – it should be a habit. When adding more and more strings to the application, you should always use strings.xml for each language in order to make those strings manageable.
When you follow this practice and use a getString() function, it displays a necessary string for a current user locale. Modifying strings is also much easier when those are not hardcoded.
Usage example:
String myString = getString(R.string.[string_to_display]);
Now, let's take another look at the "values" folder. Depending on the target language, you may detect further things available for customization:
In the long run, using a centralized folder to add all the strings is a good idea. As mentioned above, when all the strings are located within a folder for each language, adding and modifying strings becomes a much easier task. In that case, there won't be any need to chase each specific string in every location across the code.
App localization includes two main parts: adapting menus, fields, and text for a specific language, as well as using a locale to adapt the application for a specific region in which a user is located.
Let’s discuss how using a locale affects user experience. For example, the Spanish language is used in many parts of South America as well as Europe. If your application is adapted for accepting currency and other relevant information only in Mexico, it will not function properly in other Spanish-speaking countries.
In that case, a specific locale code (e.g FR-rFR) comes into play and allows to extend the user experience beyond just making your application language-compliant.
[caption id="attachment_5992" align="aligncenter" width="491"]
If you intend to launch your app in markets where people write and read right to left, then there are specific Android tools that come handy and provide the best possible experience:
RTL reading support would be a massive effort if your application hadn’t initially been designed and tested for such support. You might either fully implement RTL support or at least implement partial support of the right to left languages. Either way, Android Studio provides all necessary tools for you to test the app in RTL mode even before working with a translation team to get resources translated.
[caption id="attachment_5977" align="aligncenter" width="594"]
Android Studio’s translation editor is a utility that allows you to:
Not everything in your application needs to be translated. In this case, the "translatable = false" attribute comes into play. Why exactly is this needed? First of all, because it makes the strings file more readable for a human user. Furthermore, it gives a signal to the Lint tool that everything is correct. Finally, it shows a checkmark in the Translation Editor to make things clearer. If you try to add this translation, it will highlight it in red.
[caption id="attachment_5974" align="aligncenter" width="595"]
There are many ways to get your Android translation process smoother on the Android platform. However, Android Studio is not the most efficient software when it comes to managing the translating process itself. If you are looking for software that gives you the best way possible to communicate the localization process within your team, consider using an integrated suite of translation automation like Phrase. Sign up for a 14-day trial and see for yourself how it can streamline your Android translation process.
Last updated on August 21, 2023.