Developers
Start building
Themes/Theme SDK/Modules/i18n

i18n

Translations, theme texts, the store's languages and the one formatter.

On this page
import { … } from '@poltura/theme-sdk/i18n';

Hooks

NameWhat it is
useTranslationsThe platform's own texts, the strings the storefront ships for every theme.
useRichTranslationsPlatform texts whose marked passages the theme draws, such as the terms and privacy links in the sign-up consent.
useLocaleThe language the page renders in.
useNowThe current time, the same on the server and in the browser for the first render.
useTimeZoneThe store's time zone, which every store date renders in.
useThemeTextThe theme's own texts in the page language, live while the merchant edits them.
useFormatThe formatter for the page language and the store's time zone.
useLocalesThe page language and the other languages the storefront offers, for a language switcher.

Types

NameWhat it is
LocaleA language the store's storefront is available in.
NameOrderThe order a person's given and family names are written in.
TextValuesValues filled into the placeholders of a text.
TranslatorOne platform text by key, with its placeholders filled.
RichTextValuesValues for a text with marked passages: plain values fill placeholders, functions wrap the passage between <name> and </name>.
RichTranslatorOne platform text by key, its placeholders filled and its marked passages drawn by the given functions.
ThemeTextOne of the theme's own texts by dotted key, with placeholders and ICU plurals resolved.
MoneyFormatOptionsHow Formatter writes an amount of money.
FormatterFormats numbers, money, dates and lists in the page language and the store's time zone.
LocalesThe page language and every language the storefront offers.
Last updated