This check exists to prevent translation errors in themes.
This check is aimed at eliminating the use of translations that do not exist.
👎 Examples of incorrect code for this check:
{% # locales/en.default.json %}
{
"greetings": "Hello, world!",
"general": {
"close": "Close"
}
}
{% # templates/index.liquid %}
{{ "notfound" | t }}
👍 Examples of correct code for this check:
{% # locales/en.default.json %}
{
"greetings": "Hello, world!",
"general": {
"close": "Close"
}
}
{% # templates/index.liquid %}
{{ "greetings" | t }}
{{ "general.close" | t }}
The default configuration for this check is the following:
TranslationKeyExists:
enabled: true
It is not safe to disable this check.
This check has been introduced in Theme Check 0.1.0.