Storefront locales
This kit installs seven storefront locales. The admin shows or hides them. Adding another locale is a code change, then a deploy.
Two layers:
| Layer | Where it is set | What it controls |
|---|---|---|
| Installed | locales in src/config/site.config.ts | Locales the build can route. The Storefront Languages checklist only lists these. |
| Enabled | System → Storefront Languages (site.locales.enabled) | Language switcher, public URLs, sitemap, hreflang, and language tabs on catalog and blog forms. |
English is the default locale and stays enabled. Until you save a custom list, the public set is en, hk, jp, and kr. German, French, and Spanish are installed and disabled until you enable them.
Chrome strings (navigation, buttons, checkout labels) live in src/i18n/locales/frontend/. The admin screen does not edit them. Product, category, and blog copy are the JSON fields you import or edit in the admin. The sample catalog already includes those fields for the seven content languages below.
Installed locales
The URL prefix is the path segment. The content language is the JSON key, the blog language, and the hreflang value. Three legacy prefixes differ from that code. New locales use the same token for both.
| URL prefix | Content language | Public by default |
|---|---|---|
en | en | Yes. Always enabled. |
hk | zh-TW | Yes |
jp | ja | Yes |
kr | ko | Yes |
de | de | No |
fr | fr | No |
es | es | No |
A first visit with no locale cookie redirects to an enabled locale that matches Accept-Language. A public URL for an installed locale that is currently disabled returns 308 to the same path under en. Admin URLs stay reachable on every installed locale, including one that is hidden from the storefront, so you can turn it back on.
SEO
Canonical, hreflang, and sitemap URLs use the Site URL from System → Site Settings. Set that value before you rely on search tags.
Only enabled locales are listed. Each alternate uses the content language in hreflang and the URL prefix in the path. x-default points at en.
| URL prefix | hreflang | Example path |
|---|---|---|
hk | zh-TW | /hk/product/example |
jp | ja | /jp/product/example |
kr | ko | /kr/product/example |
de | de | /de/product/example |
de, fr, and es appear in that set after you enable them.
Add a locale
- Add the locale to
LOCALE_DEFINITIONSinsrc/i18n/localeRegistry.ts. The URL prefix and the content language are the same token. - Append that prefix to
localesinsrc/config/site.config.ts. - Add
shop/<lang>.jsonandbill/<lang>.jsonundersrc/i18n/locales/frontend/default/. The filename is the content language (zh-TW.json, not the URL prefix). Register both packs insrc/i18n/frontendMessageCatalog.ts. - Add the content language to
amplify/functions/shared/contentLanguages.ts. - Deploy, then enable the locale under System → Storefront Languages.
Catalog JSON for the new language can ship in an import pack or be entered on the product and blog forms after the locale is enabled.
Next step
The store runs from the admin without further code. Development path grades a later change to the source, when you choose to make one.