use Languagehook
hook
Returns the current language of the checkout, and automatically re-renders your component if the language changes.
Anchor to useLanguageuse Language()
use Language()
- isoCodestring
The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
Language
UseLanguageGeneratedType
Returns the current language of the checkout, and automatically re-renders your component if the language changes.
Language
export function useLanguage<
ID extends RenderExtensionPoint = RenderExtensionPoint,
>(): Language {
const {localization} = useApi<ID>();
return useSubscription(localization.language);
}
Language
- isoCode
The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
string
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
Was this section helpful?