Change Locale
When running tests with Appium, you can choose to set a specific locale for the device or emulator, by using the appium:locale
capability.
Specifying this capability will make sure the device/emulator and app will display or format data such as dates, time, decimal separators and calendars according to the specified country's regional conventions.
On iOS, you can use a locale format such as
fr_CA
to indicate you want the french region in Canada. More information is available in the Locale IDs documentation.You can also change the Simulator UI locale at runtime using the following script command:
mobile: configureLocalization
.
Android locale codes
Locale | Locale Code |
---|---|
Australia | AU |
Austria | AT |
Belgium | BE |
Brazil | BR |
Britain | GB |
Bulgaria | BG |
Canada | CA |
Croatia | HR |
Czech Republic | CZ |
Denmark | DK |
Egypt | EG |
Finland | FI |
France | FR |
Germany | DE |
Greece | GR |
Hong-Kong | HK |
Hungary | HU |
India | IN |
Indonesia | ID |
Ireland | IE |
Israel | IL |
Italy | IT |
Japan | JP |
Korea | KR |
Latvia | LV |
Liechtenstein | LI |
Lithuania | LT |
Mexico | ES |
Netherlands | NL |
New Zealand | NZ |
Norway | NO |
Philippines | PH |
Poland | PL |
Portugal | PT |
PRC | CN |
Romania | RO |
Russia | RU |
Serbia | RS |
Singapore | SG |
Slovakia | SK |
Slovenia | SI |
Spain | ES |
Sweden | SE |
Switzerland | CH |
Taiwan | TW |
Thailand | TH |
Turkey | TR |
Ukraine | UA |
US | US |
USA | US |
Vietnam | VN |
Zimbabwe | ZA |
iOS locale codes
Locale | Locale Code |
---|---|
Australia | en_AU |
Belgium | nl_BE |
Belgium | fr_BE |
Brunei Darussalam | ms_BN |
Canada | en_CA |
Canada | fr_CA |
Czech Republic | cs_CZ |
Finland | fi_FI |
Germany | de_DE |
Greece | el_GR |
Hungary | hu_HU |
India | hi_IN |
Indonesia | id_ID |
Israel | he_IL |
Italy | it_IT |
Japan | ja_JP |
Malaysia | ms_MY |
Netherlands | nl_NL |
New Zealand | en_NZ |
Norway | nb_NO |
Philippines | tl_PH |
Poland | pl_PL |
PRC | zh_CN |
Romania | ro_RO |
Russia | ru_RU |
Singapore | en_SG |
Slovakia | sk_SK |
Korea | ko_KR |
Sweden | sv_SE |
Taiwan | zh_TW |
Thailand | th_TH |
Turkey | tr_TR |
UK | en_GB |
Ukraine | uk_UA |
US | es_US |
USA | en_US |
Vietnam | vi_VN |
Brazil | pt-BR |
China (Simplified) | zh-Hans |
China (Traditional) | zh-Hant |
Hong Kong | zh-HK |
India | en-IN |
Ireland | en-IE |
Latin America | es-419 |
Mexico | es-MX |
South Africa | en-ZA |
Change Language
Specify the appium:language
capability to set the language of the app under test, and the device/emulator.
On iOS, you can set the language to for example French:
fr
. More information is available in the Language IDs documentation.You can also change the Simulator UI language at runtime using the following script command:
mobile: configureLocalization
.
Android language codes
Language | Language Code |
---|---|
Arabic | ar |
Bulgarian | bg |
Catalan | ca |
Chinese | zh |
Croatian | hr |
Czech | cs |
Danish | da |
Dutch | nl |
English | en |
Finnish | fi |
French | fr |
German | de |
Greek | el |
Hebrew | he |
Hindi | hi |
Hungarian | hu |
Indonesian | id |
Italian | it |
Japanese | ja |
Korean | ko |
Latvian | lv |
Lithuanian | lt |
Norwegian-Bokmol | nb |
Polish | pl |
Portuguese | pt |
Romanian | ro |
Russian | ru |
Serbian | sr |
Slovak | sk |
Slovenian | sl |
Spanish | es |
Swedish | sv |
Tagalog | tl |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |
iOS language codes
Language | Language Code |
---|---|
Chinese | zh |
Czech | cs |
Dutch | nl |
English | en |
Finnish | fi |
French | fr |
German | de |
Greek | el |
Hebrew | he |
Hindi | hi |
Hungarian | hu |
Indonesian | id |
Italian | it |
Japanese | ja |
Korean | ko |
Malay | ms |
Norwegian (Bokmal) | nb |
Polish | pl |
Portuguese (Brazil) | pt |
Romanian | ro |
Russian | ru |
Slovak | sk |
Spanish | es |
Swedish | sv |
Tagalog | tl |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |