Shopify Translation Missing: Find the Key, Then Fix It

A Shopify Translation missing: en.products.product.add_to_basket message is a language code followed by a key path: the key a t filter in the theme asked for and, as far as Shopify’s docs and the message itself tell us, did not find in a locale file. Open locales/en.default.json, walk that path, and look for a typo, an entry nobody added, or a key built from a variable.

The Shopify pages we read describe the filter and the files but not this message, and we did not render it on a store for this post. Its wording here is the wording merchants paste into forums, and an open issue on the Liquid repository tests for the same two words. What we did run is Theme Check, on a scratch theme, and that part is observed.

What does the message tell you?

The key is a path through nested JSON. Shopify’s storefront locale file reference names the three levels category, group and description, so products.product.add_to_basket should be an add_to_basket string inside product inside products. The translate filter, more commonly written t, returns the string for a key from the locale file of the theme’s active language.

The first segment is a language code. The pages we read do not say which file that code refers to once a fallback is involved, so read it as the language of the page and do not assume it names the file with the gap.

Where does Shopify look for the key?

Storefront strings live in locales/, one JSON file per language, named with an IETF tag such as fr.json or en-GB.json. One file, and only one, carries .default in its name. It is usually en.default.json, and it sets the theme’s default language.

More than one source can supply a key. The same reference says a regional locale such as en-CA can inherit keys from its base language file. The Help Center’s page on translating themes says a field left without a translation uses the theme’s default language. If that holds for every key, an entry missing from fr.json shows the default language’s string to a French shopper, and the message appears only when the default file has no entry either. We have not confirmed that on a store, so check both files.

A section can also define strings in a locales object inside its {% schema %} tag, and the filter reference says those are only accessible to that section. Shopify’s own checkout and customer account strings sit under the reserved shopify and customer_accounts keys, stored outside your files.

Files ending .schema.json are a different system. They translate setting labels in the theme editor and are referenced with a t: prefix inside schema JSON, not with the filter. Theme Check flagged a t call whose key existed only in the schema file.

Custom date formats come with their own warning. The reference says that if a custom format is missing from the locale file of the active language, a Liquid error is rendered, so a date_formats entry has to exist in every file.

Why is the key missing?

The first cause is a path in the Liquid that differs from the path in the JSON by one segment. Shopify’s own pluralisation example does it, as the page stood on 3 December 2026: the locale file defines customers.orders.order_count and the Liquid beside it asks for customers.order.order_count. We pasted that example into a scratch theme, and Theme Check reported the key as having no matching entry.

Case matters to the check as well. 'General.close' failed against a file that holds general.close.

The second cause is Liquid that arrived without its strings: a snippet copied from another theme, or a deploy that skipped locales/. The Help Center describes the language editor as the place to change existing wording. You reach it from Online Store, through the menu beside the theme and then Edit default theme content. The page does not mention adding a key, so plan on fixing this one in the file.

The third is a key built from data.

<span>{{ 'products.badges.' | append: tag | t }}</span>

That can only work for tags that have an entry under products.badges, and merchants add tags freely. The filter reference lists no fallback argument, and the issue asking for one has been open since 2021. The workaround posted there is to look for the message text:

{% assign badge_key = 'products.badges.' | append: tag %}
{% assign badge_label = badge_key | t %}
{% assign badge_probe = badge_label | downcase %}
{% if badge_probe contains 'translation missing' %}
  {% assign badge_label = tag %}
{% endif %}
<span class="badge">{{ badge_label }}</span>

We added downcase because we have not confirmed the capitalisation Shopify uses. Theme Check accepts the snippet’s syntax and filters, but Shopify has not rendered it for us, and it leans on a string that no reference promises.

A plural entry can exist and still fail. Passing count to the filter selects one of the CLDR keys zero, one, two, few, many or other. A comment in the source of Theme Check’s MatchingTranslations says the storefront raises when a count has no matching plural key and no other to fall back to, which is why the check insists on other in the default file.

How do you catch a Shopify translation missing error before it ships?

Theme Check has two checks for it. TranslationKeyExists reads each t call and looks the key up in the default locale file. MatchingTranslations compares every other locale file with the default. Both are errors in the recommended preset of @shopify/theme-check-node 4.1.0, the version that the theme package of Shopify CLI 5.2.0 pins as of December 2026. The checks index lists MatchingTranslations as a warning, but the preset file in the package sets it to error.

shopify theme check is the usual way to run them. We did not run the CLI for this post. We called the package it depends on, with no login and no store:

// check-translations.mjs
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { themeCheckRun } from '@shopify/theme-check-node';

const root = path.resolve(process.argv[2] ?? '.');
const wanted = new Set(['TranslationKeyExists', 'MatchingTranslations']);
const { offenses } = await themeCheckRun(root);

const lines = offenses
  .filter((offense) => wanted.has(offense.check))
  .map((offense) => {
    const file = path.relative(root, fileURLToPath(offense.uri));
    return `${file}:${offense.start.line + 1} ${offense.check}: ${offense.message}`;
  })
  .sort();

console.log(lines.join('\n'));
process.exit(lines.length > 0 ? 1 : 0);

The scratch theme’s default file held general.close, a cart.items plural with only one, products.product.add_to_cart, products.product.sold_out and two badges. Its fr.json lacked sold_out and had a third badge, limited. The snippet under test was this:

<button>{{ 'products.product.add_to_basket' | t }}</button>
<button>{{ 'General.close' | t }}</button>
<p>{{ 'products.product' | t }}</p>
<span>{{ 'products.badges.' | append: tag | t }}</span>
{% assign badge_key = 'products.badges.' | append: tag %}
<span>{{ badge_key | t }}</span>

On Node 24.12.0 the script printed this and exited with code 1:

locales/en.default.json:3 MatchingTranslations: The pluralized translation 'cart.items' is missing the 'other' key
locales/fr.json:5 MatchingTranslations: The translation for 'products.product.sold_out' is missing
locales/fr.json:6 MatchingTranslations: A default translation for 'products.badges.limited' does not exist
snippets/product-buttons.liquid:1 TranslationKeyExists: 'products.product.add_to_basket' does not have a matching entry in 'locales/en.default.json'
snippets/product-buttons.liquid:2 TranslationKeyExists: 'General.close' does not have a matching entry in 'locales/en.default.json'
snippets/product-buttons.liquid:4 TranslationKeyExists: 'products.badges.' does not have a matching entry in 'locales/en.default.json'

Three lines of the snippet are missing from that output. Line 3 asks for products.product, which is a group of strings, and passes because the check only tests that the path exists. Lines 5 and 6 pass in silence, because the check’s source returns early for any key that is not a string literal. A key held in a variable is never looked up.

Line 4 is a false positive. The check reads the literal 'products.badges.' before append runs and reports the half key.

We also tried the fixer. We applied the package’s fixes with its checkAndAutofix function, not the CLI’s --auto-correct flag. It wrote "sold_out": "TODO" into fr.json, left the extra limited key alone, and the missing-translation error went away. If the Help Center’s fallback sentence is right, the French page had been showing the English string, and after the fix it would show the word TODO. Read that diff before it merges.

What we would do

Fix the default file first, because TranslationKeyExists looks nowhere else in locales/, then give every other locale a real translation. Put both checks in CI at error level. Our guide to running Theme Check in CI covers fail levels and a baseline for older themes. Keep keys literal wherever the set of values is known, with a case tag if need be, so the check can see them.

We would not route store content through t at all where Shopify offers another way. Product titles and metafield values are translated as resources, which our post on the Translations API walks through. The string-matching workaround is for whatever is left, and it should carry a comment saying why it exists.

We customise Shopify themes and take on stores whose original developer has gone, fixing what is broken and keeping them maintained. A storefront printing key paths where words should be is that kind of job, and it is part of our Shopify development work.

Need this built properly?

Get in touch

Hack the planet!