--- url: https://developer.youcan.shop/themes/locales/schema-locale-files.md --- # Schema Locale Files Schema locale files are JSON files with a `.schema.json` file extension. They host translation strings for various setting schema attributes so that content in the theme editor can be translated to the store's active language. ## Location Schema locale files are located in the locales directory of the theme: ```bash └── theme ... ├── config └── locales ├── en.schema.default.json ├── ar.schema.json ... ``` ## Schema Locale files need to follow a specific [naming structure](#file-naming). They also follow a basic organizational structure: * **Category**: The top-level category of your translations. * **Group**: The second level grouping of translations within a category. * **Translation**: The third level, which represents the individual translations. ```json { "my_category": { "my_group": { "my_translation": "translation text", // ... }, // ... }, // ... } ``` ## File Naming You can use the 2-letter lowercase language representation to name your locale files. | Language | Format | |----------|--------| | French | `fr.schema.json` | | English | `en.schema.json` | | Arabic | `ar.schema.json` | Additionally, you must designate a [default locale file](#default-locale-file) for each type. ### Default Locale File You must designate a default locale file in the format of `*.schema.default.json`, where `*` is your selected language. This file contains the translations for the default language of the theme. Only one default file is permitted. | Example | |------------| | `en.schema.default.json` | ## Usage When working with schema locale files, you should familiarize yourself with [referencing schema translations](#reference-schema-translations). ### Reference schema translations Schema translations can be accessed with code in the the following format: ```bash t:translation_category.translation_group.translation_name ``` For example, to make the `label` attribute of the `featured-product.liquid` section translatable, use the following: :::code-group ```json [/locales/en.schema.default.json] { "sections": { "featured-product": { "label": "Product" } } } ``` ::: :::code-group ```liquid [/sections/featured-product.liquid] {% schema %} { "label": "t:sections.featured-product.label", } {% endschema %} ``` :::