Languages & direction
Translations, the locale in the URL, and right-to-left layout.
Salla stores sell in Arabic and English (and more). useTranslation gives you the translate function t, the current language and whether the page reads right-to-left.
Entries
Gives a component the translate function t, the page language, its text direction and the language name.
Theme translationsHow a theme's locales/*.json files reach t(): the Vite plugin bundles them, TwilightProvider receives them, and Salla's messages are checked first.
SUPPORTED_LOCALES & isLocaleThe 39 language codes the engine accepts at the start of a URL, and isLocale(), which tells whether a string is one of them.
getLanguageInfo & RTL_LOCALESReturns a language code's display name and text direction; RTL_LOCALES lists the four codes the engine treats as right-to-left.
FALLBACK_LOCALE, FALLBACK_DIR & FALLBACK_LANGUAGE_NAMEThe engine's assumptions when no language is known: Arabic ('ar'), written right-to-left, named العربية.
I18nProviderThe provider behind useTranslation, which TwilightProvider already mounts: it takes an i18next instance, merges theme translations into it and shares the language.