Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.
Locale API
The Locale API provides access to the merchant's current locale information in IETF format, allowing you to internationalize your extension content and respond to locale changes through subscription callbacks. The API provides both immediate locale access and change notifications for dynamic internationalization.
Anchor to Use casesUse cases
- Internationalization: Internationalize content by displaying text and numbers in the merchant's preferred format.
- Regional logic: Implement locale-specific business logic like currency formatting.
- Dynamic updates: Dynamically update interfaces when merchants change language settings.
- Localized content: Provide locale-aware product descriptions or customer communications.
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. menu-item. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. menu-item. render - pos.
return. post. action. render - pos.
return. post. block. render
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. menu-item. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. menu-item. render - pos.
return. post. action. render - pos.
return. post. block. render
Anchor to PropertiesProperties
The Locale API object provides access to the merchant's current locale information. Access the following properties on the API object to retrieve locale data and subscribe to locale changes for dynamic internationalization.
- Anchor to subscribablesubscribablesubscribableRemoteSubscribable<string>RemoteSubscribable<string>requiredrequired
Provides the current IETF-formatted locale (for example,
) and allows you to subscribe to locale changes. Supports only one subscription at a time. To enable multiple subscriptions, useon theobject. Usingor related hooks counts as an active subscription.
Anchor to Best practicesBest practices
- Implement proper formatting: Use the IETF locale format to implement proper date formatting, number formatting, currency display, and text direction based on the merchant's language and region preferences.
- Provide fallback locale handling: Implement fallback behavior for unsupported locales or when localization resources are unavailable, defaulting to a supported language like English.
Anchor to LimitationsLimitations
- The Locale API provides read-only access to locale information and can't be used to change the merchant's locale settings, which must be configured through POS system settings.
RemoteSubscribablesupports only one subscription at a time. UsemakeStatefulSubscribableif you need multiple components to subscribe to locale changes simultaneously.- The locale format follows IETF standards, but the specific locales available depend on POS system configuration and may vary between different Shopify POS installations.