XML Translator for Android: Translate Strings.xml Files with AI

Translate XML files instantly with AI. Upload your strings.xml file to PTC and localize your Android app in minutes.

20,000 words for free

Easy, 5-minute setup

Accurate translations

Get Started with Android Strings XML Translation

Step 1

Sign Up for a Free Trial

Sign up for a PTC account for a free 30-day trial to translate 20,000 words into 2 languages, no credit card needed.

Step 2

Upload Your strings.xml File and Select Languages

In the setup wizard, upload your strings.xml file and set your output paths, then choose which languages to translate into.

PTC supports 40+ languages — during the free trial, you can select any two.

Step 3

Tell PTC About Your App

Add a short description of your Android app and who uses it. By understanding your app and its audience, PTC can match the right tone and formality for each language, so your translations feel like they belong in your product.

Step 4

Download the Translated Files

When translation is complete, head to the Translations tab to review your strings. You’ll notice that all your technical elements — like %s, %d, %1$s, and XML tags — appear exactly as they did in your original file. PTC automatically recognizes and preserves these placeholders, so your translations won’t break your app’s formatting or functionality.

If PTC detects any translations that exceed your length limits, it’ll highlight them so nothing slips through. You can edit translations directly, or ask PTC to retranslate specific strings with the length constraint in mind.

When you’re ready, go to the Resource files tab and download a ZIP. It contains one translated strings.xml file per language, all following the same format as your original.

Adding Translations to Your Android Project

To use the translations in your project, create a localized values folder for each language using the correct ISO 639-1 language code:

XML
/res
  /values              <!-- Default (English) - REQUIRED -->
    strings.xml
  /values-es           <!-- Spanish -->
    strings.xml
  /values-de           <!-- German -->
    strings.xml
  /values-uk           <!-- Ukrainian -->
    strings.xml

Place the corresponding translated strings.xml file from your downloaded ZIP into each folder.

Always include a default values folder (without a language code) containing your strings.xml — this is your fallback. If Android can’t find a translation for the user’s language, it uses this one.

Once your translated files are in place, rebuild your app. Android will automatically display the correct language based on the user’s device settings.

Implementing Language Switching (Optional)

If your app includes a language switcher so users can change the language independently of their device settings, you need to save their choice and apply it every time the app starts.

Here’s how to change the language when a user selects a different one:

Kotlin
fun setLocale(context: Context, languageCode: String) {
    // Save the user's choice
    val prefs = context.getSharedPreferences("Settings", Context.MODE_PRIVATE)
    prefs.edit().putString("app_language", languageCode).apply()
    
    // Apply the new locale
    val locale = Locale(languageCode)
    Locale.setDefault(locale)
    
    val config = Configuration()
    config.setLocale(locale)
    context.resources.updateConfiguration(config, context.resources.displayMetrics)
    
    // Restart the activity so changes take effect
    if (context is Activity) {
        context.recreate()
    }
}

Then, in your Application class or main activity’s onCreate(), load the saved language preference:

Kotlin
override fun onCreate() {
    super.onCreate()
    
    val prefs = getSharedPreferences("Settings", Context.MODE_PRIVATE)
    val languageCode = prefs.getString("app_language", "en") ?: "en"
    
    val locale = Locale(languageCode)
    Locale.setDefault(locale)
    
    val config = Configuration()
    config.setLocale(locale)
    resources.updateConfiguration(config, resources.displayMetrics)
}

This saves the user’s language choice so it persists between sessions, and works correctly after you publish your app to Google Play.

Moving to Continuous Localization for Android 

Once you’ve seen PTC in action, you can move beyond manual uploads and keep translations in sync automatically as your strings.xml file changes. PTC gives you two ways to do this:

Option 1

Automate with Git Integration

Go to Settings → Merge Requests and click Add Git Integration to connect your GitHub, GitLab, or Bitbucket repository to PTC.

You’ll need to provide an access token with read and write permissions and choose the branches you want PTC to monitor. From there, PTC detects changes, translates new or updated strings, and opens a merge request for your review.

Option 2

Automate with PTC’s API

If you’d prefer to keep everything inside your existing build process, go to Settings → Manage API Tokens and click Add Access Token.

Then check the complete API documentation for all available endpoints. For new subsequent projects, you can select API integration from the very start of the setup wizard.

Frequently Asked Questions about Android Localization

Try PTC for free

Want to see PTC’s translation quality and ease of use first-hand? Sign up for the trial and translate 20,000 words into 2 languages for free.

Scroll to Top