Android Localization: How to Translate a Strings XML File with PTC

PTC delivers Better Than Human AI translation for Android string.xml files and Google Play Store descriptions. This tutorial shows how to translate your Android app into any language and make it look fully native.

Translating Your Application for the First Time with PTC

The first setup takes a bit of effort. You’ll prepare your app, connect it to PTC, provide some context, and set the output location for translated files. After that, PTC handles translation updates automatically whenever your code changes.

Step 1: Make Sure Your strings.xml File Contains All User-Facing App Texts

Store every user-facing string in your strings.xml file. This lets PTC extract all texts and translate them accurately.

Correct – Text stored in the strings.xml file:

strings.xml:

<string name="welcome">Welcome back!</string>

Code:

textView.setText(getString(R.string.welcome));

Incorrect – Text hardcoded in the source code

textView.setText("Welcome back!");

Hardcoded strings won’t be extracted by PTC, so they’ll stay in English and won’t be translated at all.

Step 2: Use Placeholders for Dynamic Texts

Use %s, %d, etc., as placeholders when your app includes dynamic content like user names or numbers. Avoid splitting up a sentence or using string concatenation.

Correct – One complete string with placeholders:

strings.xml:

<string name="greeting">Hello, %1$s! You have %2$d new messages.</string>

Code:

String name = "John";
int count = 3;
textView.setText(getString(R.string.greeting, name, count));

Incorrect – Sentence is split and concatenated:

strings.xml:

<string name="greeting_1">Hello, </string>
<string name="greeting_2">! You have </string>
<string name="greeting_3"> new messages.</string>

Code:

String name = "John";
int count = 3;
textView.setText(getString(R.string.greeting_1) + name +
                 getString(R.string.greeting_2) + count +
                 getString(R.string.greeting_3));

This example breaks the sentence into pieces. Translations may not follow the same word order or grammar rules, so the final result will be unnatural or even incorrect.

Step 3: Verify Encoding for Special Characters

Make sure your strings.xml file is saved in UTF-8 to support special characters, accents, and non-Latin alphabets. Android Studio does this by default.

Step 4: Create a PTC Account (Free for 30 Days)

Create your free-trial account, which gives you full access to all PTC features for 30 days.

Step 5: Give PTC Access to Read Your Repo and Write Back Translations

PTC integrates with your GitLab, GitHub, or Bitbucket repository, which means that you don’t need to manually send resource files to translation and you don’t need to download completed translations. Whenever PTC sees new texts to translate, it will handle it automatically and send you back a merge request (MR) with the new or updated translated resource files.

PTC will also create the correct folders in the MR (e.g., res/values-es/strings.xml for Spanish), so you don’t need to prepare them in advance

Step 6: Choose Languages You Want to Translate Into

Select any of the supported languages. PTC translates to over 33 languages with context-aware accuracy.

Step 7: Tell PTC About Your App and Target Audience

Tell PTC your app’s name, what it does, and who it is for. This context helps PTC choose the right tone, terminology, and phrasing so the translations feel natural in each language.

Step 8: Add the Description Texts to PTC

Go to Translations → Paste to translate and add your app’s short and long description texts. These are not part of the strings.xml file, so you need to paste them manually. PTC will translate the texts, and you can then copy and paste the results into the Google Play Store.

Step 9: Let Google Play Know About the Available Languages

Once your translated strings.xml files are in your Git repository, rebuild your app. Android will automatically show the correct language based on the user’s device settings—no further changes needed in your code.

But to make your app fully localized on the Play Store, you also need to update the store listing:

  1. Go to Google Play Console → Store Presence → Main Store Listing → Translations
  2. Add your translated short and long descriptions for each language
  3. Save and publish

This makes your app discoverable and appealing to users in their own language.

How PTC Keeps Your Translations Up to Date

Once you set everything up, you won’t need to think about translations. When PTC detects changes to your app’s resource files, it automatically creates a merge request with the updated translations. It can also monitor multiple Git branches, so translations stay up to date as your team builds new features.

The only manual step is updating your app’s description. If it changes, just paste the new version into Paste to translate and PTC will handle the rest.

Start your free trial today

Easily translate your strings.xml file with PTC and make your Android app ready for global users—all free for 30 days.

Scroll to Top