Set Device Language (FR)

Perfecto Command

perfecto:language:set

Purpose

Sets the language of a mobile device using automation.

Important: Changing the device language initiates a reboot, which terminates your current Appium session. To continue testing, you must establish a new session after the device restarts.

Limitations

The following limitations apply:

  • The device will reboot after the language is changed.

  • Supported languages are limited to the following list:

    ar-AE, zh-Hans-CN, en-US, fr-FR, fr-CA, de-DE, he-IL, it-IT, ja-JP, ko-KR, pt-BR, ru-RU, es-ES

Parameters

Name Type Possible Values Description

language

String

ar-AE, zh-Hans-CN, en-US, fr-FR, fr-CA, de-DE, he-IL, it-IT, ja-JP, ko-KR, pt-BR, ru-RU, es-ES

Language code to set on the device

Return Value

OK - if successful

Exceptions

None

Examples

Copy

Java sample

Map<String, Object> params = new HashMap<>();
params.put("language", "en-US");
driver.executeScript("perfecto:language:set", params);
Copy

C# sample

Dictionary<string, object> pars = new Dictionary<string, object>();
pars.Add("language", "en-US");
driver.ExecuteScript("perfecto:language:set", pars);

What's next?

For steps, see Set the device language using automation.