Locale files are JSON files that contain a set of translations for text strings used throughout the theme.
- Storefront - These have a
.jsonextension, and control storefront translations.
Locale files are hosted in the
locales directory of a theme.
Both locale file types follow the same general format of being organized into the following levels:
- Category: The top-level category of your translations. For example,
generalcontains general translations.
- Group: The second level grouping of translations within a category. For example,
404contains general translations related to the 404 page.
- Description: The third level, which represents the individual translations. For example,
titlecontains the title of the 404 page
When naming translation descriptions, try to be descriptive enough to give the translation context. For example,
blogs.article_comment.submit_button_textgives more context than
Add a new locale file through the theme code editor.
To add a new locale through the code editor:
- From your Shoplazza admin, go to Store > Themes.
- Find the theme you want to edit, and then click Operation > Theme code.
- Scroll down the left sidebar and click Locales, then click Add a new locales.
- Enter a name for the file, without the
.jsonextension, then click Confirm.
Refer to Name locale files for information on how these files should be named.
Locale file naming must follow the standard IETF language tag nomenclature, where the first lowercase letter code represents the language, and the second uppercase letter code represents the region.
en-GB.jsonfor English - Great Britain
es-ES.jsonfor Spanish - Spain
fr-CA.jsonfor French - Canada
Updated 24 days ago