Skip to main content

Localization

The API for localizing your extension.

The base API object provided to this and other customer-account extension targets.

required

Utilities for translating content and formatting values according to the current localization of the user.

Anchor to localization
localization
required

Details about the language of the buyer.

Examples
/* See the locales/en.default.json tab for the translation keys and values for this example */
import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default async () => {
render(<Extension />, document.body);
};

function Extension() {
return (
<s-text>
{shopify.i18n.translate('welcomeMessage')}
</s-text>
);
}
Was this page helpful?