Use localization options for Maestro tests
Test localized versions of your apps by changing the language and locale settings for your Maestro test executions on BrowserStack App Automate for both Android and iOS platforms.
BrowserStack App Automate allows you to test localized versions of your application using Maestro. You can simulate different languages and regional settings to ensure your app behaves correctly for a global audience.
This guide outlines how to configure app-level locale and language settings for both Android and iOS platforms.
-
Localization settings change configuration at app level for Maestro tests.
-
BrowserStack’s paid plans offer access to localization features. You can check the available paid plans.
Configuration
For iOS, use the launchApp command in your Maestro flow to handle localization. For Android, use the REST API. You can pass platform-specific arguments to override the default device settings.
Available parameters
You can pass these parameters as a group or individually:
| Parameter | Description | Values |
|---|---|---|
Android: locale iOS: AppleLocale
|
Set the locale (region) of the app. Controls region formatting such as date formats, currency, and number separators. |
Example: ‘CA’ (Android), ‘fr_CA’ (iOS) Format: Country code (Android), Language_Country code (iOS) You can view the complete list of country codes on Wikipedia. |
Android: language iOS: AppleLanguages
|
Set the language of your app. Controls the language strings displayed within the application. |
Example: ‘fr’ (Android), ‘(fr_CA)’ (iOS) Format: Language code (Android), (Language_Country) enclosed in parentheses (iOS) You can view the complete list of language codes on Wikipedia. |
iOS only: AppleTextDirection
|
Optional parameter to force text direction. Prevents automatic text direction switching. |
Values: yes, no Example: no (to prevent automatic LTR/RTL switching) |
Setting the locale (region)
The locale argument controls the region formatting such as date formats, currency, and number separators.
To set the region, add the following to your launchApp step:
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/android/build" \
-H "Content-Type: application/json" \
-d '{
"app": "bs://9c6dcb5649a8280ca800075bfd8f151115bba6b3",
"testSuite": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1",
"project": "Maestro_Test",
"devices": [
"Samsung Galaxy S20-10.0",
"Google Pixel 7-13.0"
],
"locale": "CA"
}'
Setting the language
The language argument controls the language strings displayed within the application. This determines the text language used in your app’s user interface.
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/android/build" \
-H "Content-Type: application/json" \
-d '{
"app": "bs://9c6dcb5649a8280ca800075bfd8f151115bba6b3",
"testSuite": "bs://89c874f21852ba57957a3fdc33f47514288c4ba1",
"project": "Maestro_Test",
"devices": [
"Samsung Galaxy S20-10.0",
"Google Pixel 7-13.0"
],
"language": "fr"
}'
The AppleLanguages argument controls the language strings displayed within the application. You can also enforce text direction (LTR/RTL) using AppleTextDirection.
To set the language, add the following to your launchApp step:
Related topics
- Get started with Maestro
- Configure Maestro tests
- Structure your Maestro tests
- Upload and manage apps using REST API
- For questions or support, contact us.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!