useLocalization
The useLocalization
hook returns the locale, country, and language of the current page. It can be used within server or client components and it must be a descendent of a ShopifyProvider
component.
Example code
Anchor link to section titled "Example code"
Return value
Anchor link to section titled "Return value"This hook returns an object with the following properties:
Property | Description |
---|---|
country |
An object with the country's isoCode . |
language |
An object with the language's isoCode . |
locale |
A locale string, which includes the isoCode of both the language and country . For example, en-US . |