---
title: How to do localisation testing for mobile apps
description: Find out how to perform localisation testing with mobile apps. Change
  your language or locale with Appium, XCUITest and Espresso.
source_url:
  html: https://testingbot.com/resources/articles/localized-testing-mobile-app
  md: https://testingbot.com/resources/articles/localized-testing-mobile-app.md
---

![How to do localisation testing for mobile apps](https://testingbot.com/assets/resources/articles/12.webp)

# Language and locale automated testing on mobile apps

Find out how to perform localisation testing with mobile apps. Change your language or locale with Appium, XCUITest and Espresso.

By [Jochen D.](https://testingbot.com/about/jochen-d)2021-11-10Updated 2026-08-31

 Share on Facebook 

 Share on Twitter 

 Post on Reddit 

 Share link 

Localization testing allows you to test your native mobile app on iOS and Android devices with various language and localization settings.   
 It is important to make sure that your mobile app works correctly on devices with other languages and locales, both functionally and in terms of design.

Some languages might use longer sentences than English, which might break your UI.   
 For example, you have a sentence in your app that fits perfectly inside the UI for English, but the translation in Portuguese is too long, causing the sentence to go beyond the allowed size.   
 Another example is where your app displays a number, currency, or date in a different format due to other locale settings. Setting various locale settings during your tests will allow you to test all these scenarios.

In this article we'll focus on how to perform language and locale testing, with both Appium, [XCUItest](https://testingbot.com/support/app-automate/appium) (iOS) and Espresso (Android).

## Table of Contents

- [What is the difference between language and locale?](https://testingbot.com#difference)
- [How to change the language in an Appium test?](https://testingbot.com#language)
- [How to change the locale in an Appium test?](https://testingbot.com#locale)
- [How to set a different language or locale with XCUITest?](https://testingbot.com#xcuitest)
- [How to change the language or locale with Espresso?](https://testingbot.com#espresso)

## What is the difference between language and locale?

The terms locale and language are often used in the same context, but they have different meanings.

The term language indicates the language on the device. It is the language used in the UI of the device's OS and can often be changed in the Settings menu of your OS.   
 Examples of a language are: English, French, Portugese, Dutch, Spanish, Chinese and more. iOS supports more than 30 languages, while Android supports a larger amount of languages.

Locale refers to regional settings, for a specific country or place. This includes settings such as currency format, number format, or date formats.   
 Countries can share the same language, but have different locale settings.

To get a list of available locales on Android, you can use this snippet of code:

```java
for (Locale locale : Locale.getAvailableLocales()) {
	Log.d("LOCALES", locale.getLanguage() + "_" + locale.getCountry() + " [" + locale.getDisplayName() + "]");
}
```

## How to change the language in an Appium test?

Appium provides a `language` capability, which you can use to pass in the desired language code (ISO 639-1) of the app under test.

When you compile your `IPA` or `APK` file, you can indicate which languages you want to support and provide the translated content.   
 For Android, translated content usually appears in [strings.xml](https://developer.android.com/studio/write/translations-editor) files, while on iOS you can use [XCode's localization features](https://developer.apple.com/documentation/xcode/localization).

```java
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("language", "es");
```

To fetch a all translated strings for a specific language, you can use the `app_strings` command:

```javascript
let appStrings = driver.getStrings("<language_code>");
```

## How to change the locale in an Appium test?

To change the locale, you can use Appium's `locale` capability, which accepts [region codes](https://www.iban.com/country-codes).

By changing the locale, you can test regional settings, such as currency formats, date formats, time and calendar formats.   
 All these settings are country/region specific and can be tested with Appium's `locale` capability.

```java
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("locale", "fr_CA");
```

> Changing the language or locale will change the settings on a device level for Android, and on an app-level for iOS.

## How to set a different language or locale with XCUITest?

XCUITest offers two arguments which you can use to set the language or locale:

- `-AppleLanguages`
- `-AppleLocale`

To use this in XCUITest, you can pass in a language or locale of your choosing like this:

```swift
XCUIApplication().launchArguments += [“-AppleLanguages”, “(fr)”]
XCUIApplication().launchArguments += [“-AppleLocale”, “fr_FR”]
XCUIApplication().launch()
```

In the example above, we set the language to French and the locale to France/French.   
 XCUITest will open the app with these settings. If your app has localized strings for this language, your app should display in the correct language.

Apple provides some more information about setting up and testing localized apps in their [Testing your International App documentation](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html#//apple_ref/doc/uid/10000171i-CH7-SW2).

## How to change the language or locale with Espresso?

During an Espresso test, you can programmaticaly switch the language or locale of the app.   
 Please see the example below on how to achieve this:

```java
private void setLocale(String language, String country) {
    Locale locale = new Locale(language, country);
    // here we update locale for date formatters
    Locale.setDefault(locale);
    // here we update locale for app resources
    Resources res = getContext().getResources();
    Configuration config = res.getConfiguration();
    config.locale = locale;
    res.updateConfiguration(config, res.getDisplayMetrics());
}
```

This function accepts a language and country, it will update the locale and resources during the Espresso test.

Topics [Mobile App Testing](https://testingbot.com/resources/articles/topic/mobile-testing) 

## Sidebar

### TestingBot Cloud Testing

Run automated, manual and visual tests on remote browsers and devices. Sign up for a free trial.

[Free Trial](https://testingbot.com/users/sign_up)

### Latest articles

[![Mobile App Test Automation at Scale](https://testingbot.com/assets/resources/articles/mobile-app-test-automation-12d7e7edc7c551f05282cd03ccd0de42da8e4c740d754286777972249471a36e.webp)](https://testingbot.com/resources/articles/mobile-app-test-automation)

#### [Mobile App Test Automation at Scale](https://testingbot.com/resources/articles/mobile-app-test-automation)

How to choose between Appium, Espresso, XCUITest and Maes...

[Read article →](https://testingbot.com/resources/articles/mobile-app-test-automation)

[![Run Maestro tests in the cloud](https://testingbot.com/assets/resources/articles/45-54aab6a840d2561eab846e8bfde7ec26113ba601a9fcc15ddea883c2a80ec29c.webp)](https://testingbot.com/resources/articles/maestro-cloud-testing)

#### [Run Maestro tests in the cloud](https://testingbot.com/resources/articles/maestro-cloud-testing)

What Maestro is, how its declarative flows differ from Ap...

[Read article →](https://testingbot.com/resources/articles/maestro-cloud-testing)

[![Appium 2 and Appium 3 Migration Guide](https://testingbot.com/assets/resources/articles/27-121da26036885301ba438e1cdfc81e7ae8045cbc53c0dafaff5b4436000590b1.webp)](https://testingbot.com/resources/articles/appium-2-migration)

#### [Appium 2 and Appium 3 Migration Guide](https://testingbot.com/resources/articles/appium-2-migration)

What changed between Appium 1, 2 and 3: drivers, capabili...

[Read article →](https://testingbot.com/resources/articles/appium-2-migration)

## Other Articles

[![Automate native iOS Apps with XCUITest](https://testingbot.com/assets/resources/articles/25-bb2ccb531384c461ef792214839e9e8f99a4b08b1293730ceeab67e4a8352563.webp)](https://testingbot.com/resources/articles/automate-native-ios-apps-xcuitest "Automate native iOS Apps with XCUITest")

### [Automate native iOS Apps with XCUITest](https://testingbot.com/resources/articles/automate-native-ios-apps-xcuitest)

How to automate Apple's own iOS apps with XCUITest, with code for driving Settings, Messages and Photos, and how to extend it to other apps.

[Read article →](https://testingbot.com/resources/articles/automate-native-ios-apps-xcuitest)

[![Using Touch Actions with Appium](https://testingbot.com/assets/resources/articles/24-490f70ad8a80e4534523707125b88e44e70fe19b126be4f44e689bbd5f6a0cbf.webp)](https://testingbot.com/resources/articles/touch-actions-appium "Using Touch Actions with Appium")

### [Using Touch Actions with Appium](https://testingbot.com/resources/articles/touch-actions-appium)

How to simulate taps, swipes and pinches on real devices with Appium Touch Actions, with examples, best practices and common pitfalls.

[Read article →](https://testingbot.com/resources/articles/touch-actions-appium)

[![How to Inspect Element using UIAutomatorViewer](https://testingbot.com/assets/resources/articles/23-d6314d62f1aa6a6c51fb960d1b65bc3aeb14ee0ade20527f6546bfd5777536d2.webp)](https://testingbot.com/resources/articles/android-uiautomatorviewer "How to Inspect Element using UIAutomatorViewer")

### [How to Inspect Element using UIAutomatorViewer](https://testingbot.com/resources/articles/android-uiautomatorviewer)

How to use UIAutomatorViewer from the Android SDK to inspect app screens and find the selectors your automated Android tests need.

[Read article →](https://testingbot.com/resources/articles/android-uiautomatorviewer)

[![Dark Mode Testing with Appium](https://testingbot.com/assets/resources/articles/22-ed15fa0f3fde7566416fff5078b44689dc274439b2fb829f8c68603e909a65d6.webp)](https://testingbot.com/resources/articles/dark-mode-testing "Dark Mode Testing with Appium")

### [Dark Mode Testing with Appium](https://testingbot.com/resources/articles/dark-mode-testing)

How to switch a native app between light and dark mode from an Appium test on iOS and Android, and the layout bugs dark mode tends to expose.

[Read article →](https://testingbot.com/resources/articles/dark-mode-testing)

## Ready to start testing?
[Start a free trial](https://testingbot.com/users/sign_up)
