Skip to main content

ValidSchemaTranslations

Makes sure that every translation key (t:) referenced inside a {% schema %} tag has a matching entry in the default schema locale file.

This check inspects all string values in the schema JSON—including name, label, info, category, preset values, option labels, and any other translation-key reference—and reports any that can't be resolved.


The following examples contain code snippets that either fail or pass this check.

In the following example, the t:sections.header.missing_key translation key isn't defined in the default schema locale file:

{% schema %}
{
"name": "t:sections.header.missing_key"
}
{% endschema %}

locales/en.default.schema.json

{
"sections": {
"header": {
"name": "Header"
}
}
}

In the following example, every t: translation key used in the schema has a matching entry in the default schema locale file:

{% schema %}
{
"name": "t:sections.header.name",
"settings": [
{
"type": "text",
"id": "title",
"label": "t:sections.header.settings.title.label",
"info": "t:sections.header.settings.title.info"
}
]
}
{% endschema %}

locales/en.default.schema.json

{
"sections": {
"header": {
"name": "Header",
"settings": {
"title": {
"label": "Title",
"info": "Enter a title"
}
}
}
}
}

In the following example, a translation key inside a nested blocks array is missing from the default schema locale file:

{% schema %}
{
"name": "t:sections.header.name",
"blocks": [
{
"type": "text",
"name": "t:sections.header.blocks.text.name"
}
]
}
{% endschema %}

locales/en.default.schema.json

{
"sections": {
"header": {
"name": "Header"
}
}
}

The following example contains the default configuration for this check:

ValidSchemaTranslations:
enabled: true
severity: error
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

Disabling this check isn't recommended because unresolved translation keys surface as raw t:... strings in the theme editor and can ship a broken merchant experience.


Was this page helpful?