A Step-by-Step Guide to Android Localization

Did you know that Android has 72.83% of the global mobile operating system market share, and Google Play Store is available in over 146 countries?

If you want to enter the global market, you should localize your app to make it relevant and appealing to Android users.

You have probably heard of the term localization. But what does the process entail, and how to localize your app for Android phones?

What’s Android Localization?

Localization (l10n) is the process that turns the content on an app or website into other languages. Besides translation, you also need to consider cultural references, slang, etc., to ensure that the content resonates with the local audience while communicating a consistent brand image.

Android localization also involves adjusting various elements, such as the formatting for date, time, numbers, and currency, to avoid misunderstanding and frustration. You may need to update audio files, add captions to videos, and adjust graphics to make them appropriate for the local market.

What’s Android Localization?

How To Localize an Android App

You can localize your Android App using Android Studio. Here are the key steps to follow in your Android localization project:

Internationalize Your App

Before you start the localization process, internationalize your app to remove language dependencies (e.g., ensure that text is not hardcoded.) For example, you should move text and images to separate files and use specific functions to handle different display formats.

Identify elements in the app that will require localization. The usual suspects include text strings, images, audio files, and date, time, number, and currency formats. Consider how different text lengths may affect the layout and how text direction may impact the user experience.

Internationalize Your App

Plan Your Android Localization Project

Decide which countries and languages you will support, and prioritize them based on market size, sales potential, or other factors. Then, assemble a team that consists of a localization manager, developers, designers, translators, reviewers, as well as local marketers and legal advisers.

Next, map out your localization workflow, validate the timeline, and select a localization platform to help you manage translation tasks and all the other moving pieces to ensure that nothing falls through the cracks.

Create a New Android Project

Here’s the good news: Android comes with built-in internationalization (i18n) features, so you don’t have to start from scratch. When you create a new project using Google’s Android SDK tool, it will automatically generate files needed for app localization. You can also download our sample Android project to get started.

You’ll find a /res/ directory at the top level of the project. It contains the default files you need, such as res/values/strings.xml for storing string resources separately, so you don’t have to hardcode text into your app.

Select Your Locale

A locale combines a country and a language to represent a geographical, political, or cultural region. For example, the U.S. and the UK are two different locales. Even though users in both countries speak English, they use different formats to experience date, time, and numbers. They also use different expressions and call the same things differently (e.g., truck vs. lorry.)

Select Your Locale

Don’t Hard Code Text or Resources

Avoid hardcoding text or resources so your app can adapt to different languages, regions, and cultures in a flexible, scalable, and efficient way. Place text and resources in the default strings.xml file, which will allow you to easily modify the content for multiple locales without recompiling the source code.

Another way to make the localization process more cost-efficient is to avoid including text in images. Instead, keep the text as strings whenever possible, so you don’t have to create a new graphic for every language.

Make strings.xml Translator-Friendly

Often, translators who work on your content may only see the strings without much knowledge about your app or brand. Make their jobs easier by including information about the context of each string in the strings.xml file.

Providing context is particularly important for shorter text. For instance, “clear” in English can mean either delete or transparent, depending on how the word is used. Providing contextual information can help you efficiently manage text strings and increase translation accuracy to produce high-quality localized content.

Mark Content That Doesn’t Require Translation

Some content, such as code, value placeholder, special symbols, or proper nouns, won’t require translation. Indicate these texts using an <xliff:g> tag, so translators know not to change them.

You can also use the id attribute to explain the purpose of a placeholder text or an example attribute to show how you plan to display the string using the placeholder to provide more context.

Organize Your Resources

Resources refer to static assets such as text strings, graphics, images, sounds, etc., used by an Android app. You may need to create multiple sets of resources, each for a specific device configuration (e.g., selected language, screen size, country code, etc.) Android will automatically load the resources most appropriate for a user’s device and locale.

To start, create specific directories within res/, one for each locale. Use the naming format “values-<ISO language code>” for text string resources and put locale-specific graphics and layout into the res/drawable-<qualifiers>/ and res/layout-<qualifiers>/ folders.

Define Default Resources

What if the resources are incomplete for a specific user’s locale? Then, Android will display the default version of app resources.

To define default resources, place them in the app’s res/ directory. The app’s default language should be one most likely to be used by your target audience. Then, put localized sets in appropriately named subdirectories within the res/ directory.

Ensure Resource Sets Are Complete

If a resource doesn’t exist in the default directory, the application won’t run, and users will see an error. To ensure a seamless user experience, verify that a default resource is defined for each reference in your Android app.

While Android will pull default resources if the localized version doesn’t exist, this would often lead to poor usability and a disjointed user experience. It’s best to double-check that all the resource sets are complete, and keep incomplete localized sets separate from the app until you have everything ready.

Keep Resource Files to a Minimum

Keeping all your resource sets current and in sync requires substantial time and effort when you expand into different markets. To streamline workflows and avoid errors, keep the number of resource files to a reasonable minimum without impacting the user experience.

For example, separating images from text means you only need to update one graphic for most locales. When localizing for regions with variations that overlap extensively, such as the U.S. and UK market, you can set American English as the default and only translate a small amount of text containing different nouns or expressions.

Pluralize Nouns

Getting pluralization right can be tedious because each language has unique grammatical rules, so you’ll need to create separate “plurals” elements for each language. The good news is that Android’s built-in support for quantity strings (plurals) will make it a breeze.

Display Date, Time, Numbers, and Currencies Correctly

Just like text strings, don’t hardcode these locale-specific elements into the app. Thankfully, Android has several built-in utilities to help you format them correctly across locales.

Use the “getDateTimeInstance” provided in the DateFormat class to ensure that the date and time are displayed appropriately for each locale. The String.format() or DecimalFormat does the same for numbers and currency, while PhoneNumberUtils can be used for phone numbers.

Review Translated Text

When you get the translated text from your translation service, move the files into the resource structure in your app. Use the appropriate language and locale qualifiers to ensure proper loading based on the selected region. Then, test the app for each locale and check that everything is displayed correctly.

android localization qa checklist

Optimize Your Keywords

Translate your app description for Google Play Store and target the right keywords for each locale. Research and select keywords based on the market, e.g., consider the competitiveness of each keyword and your audience’s search behaviors.

It’s best to work with a local SEO expert to find the most effective keywords, keeping in mind that they may differ from those in the default language version.

Upload to Google Play

After you have ticked all the boxes, now it’s time to sign the app, make the final build, and upload it to Google Play.

Select the language for your localized app and upload the .apk file. Then, add translations for the store listing page, Google Ads campaign, and the localized versions of promotional graphics or videos for each language.

Managing All the Moving Parts of Android Localization

Android localization may not be a stroll in the park, but the good news is that you don’t have to do it all on your own! Savvy global brands, developers, and product managers use robust localization platforms to help them translate, localize, and test their apps.

OneSky’s end-to-end localization solution allows you to work with 19 file formats, order professional translations in 50+ languages, and communicate with your translators all in one place. Learn more and get started for free.

Jac Wong

Chief Technology Officer, OneSky

Popular post

Leave a Reply

Your email address will not be published. Required fields are marked *

Resources

Localization Resources
to get you started