Localization
The APIs used to localize your extension.
localization: Localization
localization
The details about the current location, including the language and currency that the buyer uses.
render("Checkout::Dynamic::Render", (props) => {
const { localization } = props;
console.log(localization);
});
i18n: I18n
i18n
Used to translate content according to localization during checkout.
/* Refer to the following locales/en.default.json file to obtain the translation keys and values for this example */
render('Checkout::Dynamic::Render', (props) => {
const { i18n } = props;
return <Text>{i18n.translate("welcome", { name: "tony" })}</Text>;
});
{
"welcome": "Welcome to our store {{name}}!"
}
Was this article helpful to you?