How to Translate strings.xml and Add a Language in Android Studio

By The strings.dev team · Last updated

Frequently asked questions

How do I translate strings.xml in Android Studio?

Open res/values/strings.xml and click Open Translations Editor (the globe icon on the editor banner), or right-click the file in the Project view and choose Open Translations Editor. You get a grid with one row per string key and one column per locale. Add a locale with the globe (+) Add Locale button, then type each translation into its cell. Android Studio writes the values into the correct values-<locale>/strings.xml file for you.

How do I add a language in Android Studio?

In the Translations Editor toolbar, click the globe (+) Add Locale button and pick a language — for example French (fr). Android Studio immediately creates res/values-fr/strings.xml and adds an fr column to the grid. Choosing a language with a region, like Spanish in Mexico, creates res/values-es-rMX/strings.xml.

What is the difference between values-fr and values-es-rMX folders?

values-fr is a language-only qualifier (French, any region). values-es-rMX adds a region: the lowercase r prefix followed by the uppercase ISO region code, so it targets Spanish specifically for Mexico. Use language-only folders for one universal translation and language-plus-region folders when vocabulary differs by market, like es-ES versus es-MX or pt-BR versus pt-PT. Script variants such as Simplified Chinese use the BCP-47 form, values-b+zh+Hans.

Does the Translations Editor handle plurals?

Its support for <plurals> is limited — quantity strings surface awkwardly in the grid, so it's usually cleaner to edit them directly in each locale's strings.xml. Declare only the CLDR quantity categories a language actually uses (one, few, many, other for Russian; one, other for English) and resolve them with getResources().getQuantityString(). A target language often needs few and many forms your English source never defined.

How do I translate strings.xml into all my languages at once?

The Translations Editor is manual, one cell per locale, so it doesn't scale past a couple of languages. Export res/values/strings.xml — it's already the native format, no XLIFF conversion — and upload it to strings.dev, then pick your target locales. You get a strings.xml back per locale with placeholders, <plurals>, and brand phrases preserved. Drop the files into your values-* folders. The free Indie tier covers 1 project and 1 language; unlimited languages is Indie Plus at $20/mo, or $10/mo billed annually.

Related

Fill every locale free with strings.dev