Author:
    Creation:2026-09-02Last update:2026-09-02

    How to find missing translations before your users do

    A missing translation almost never throws. Depending on your setup it either shows the English string to a Japanese user, or prints checkout.summary.total on a live page. Both ship, both pass code review, and both are found by a customer rather than by you.

    Table of Contents

    This applies whatever library you use

    Nothing here is specific to one stack. The detection layers below work the same on i18next, react-i18next, next-intl, react-intl, vue-i18n, next-translate or Lingui, because they all resolve keys the same way and all fail the same way.

    The tooling is portable too. If your messages live in JSON catalogues today, the Sync JSON plugin points Intlayer at those files, so you get the audit, fill and test commands without moving your content or changing a single import:

    intlayer.config.ts
    import { syncJSON } from "@intlayer/sync-json-plugin";
    
    const config = {
      plugins: [
        syncJSON({
          source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
          format: "i18next", // or "icu" for next-intl / react-intl
        }),
      ],
    };
    
    export default config;
    

    If you want the runtime API to stay identical as well, the compat adapters alias useTranslation, $t and friends at the bundler level. Either way, treat the commands below as one implementation of the idea, not as a requirement.

    Why they are invisible

    Every i18n library resolves a key through the same chain: look up the active locale, fall back to a default, and if that fails, return the key itself. That last step is the problem. There is no error, no warning in production, and no failing test, because nothing in the pipeline treats a missing key as abnormal.

    Fallback makes it worse, not better. A page that silently renders in English looks fine to an English-speaking developer and to every automated check you have. The bug is only visible to the person who cannot read the result.

    So the question is not "how do I handle missing translations at runtime". It is "how do I make a missing translation impossible to merge".

    The four places you can catch them

    Each layer catches something the others cannot. You want more than one.

    Layer Catches Misses
    Types Keys that do not exist at all A key that exists but is untranslated in ja
    Lint Hardcoded strings never sent for translation Keys missing from a catalogue
    Audit Locale coverage across every declared key Text that was never made translatable
    Rendering tests Keys that resolve but render wrong Everything not covered by a test

    The gap most teams have is the third row: they know their keys are valid, but nothing checks that all eighteen locales actually have a value.

    Layer 1: make the key a type, not a string

    t("checkout.summry.total") is a typo that compiles. If your keys are plain strings, every rename is a runtime risk and every deletion leaves an orphan.

    Typed keys turn that into a build error. react-i18next supports it through declaration merging, next-intl infers from your message shape, Lingui derives IDs from the source text, and Intlayer generates types from the declaration files. All of them work; what differs is how much you have to wire up.

    This layer is necessary and not sufficient. Types describe the shape of your default catalogue. They say nothing about whether Korean has a value for that key.

    Layer 2: lint the strings that never became keys

    The translation you cannot find is often the one that was never externalised. A hardcoded label in a component is invisible to every catalogue-based audit, because as far as the tooling is concerned it does not exist.

    Intlayer's ESLint plugin covers this with no-raw-text, plus no-unused-content for the reverse case: content declared and no longer read by anything.

    eslint.config.mjs
    import intlayer from "@intlayer/eslint-plugin";
    
    export default [
      intlayer.configs.recommended,
      {
        rules: {
          "@intlayer/no-raw-text": "error",
          "@intlayer/no-unused-content": "warn",
        },
      },
    ];
    

    no-unused-content is the one that keeps catalogues from growing forever. Dead keys are not a correctness bug, but they are what makes a translation vendor invoice larger than it should be. Full rule list in the ESLint plugin doc.

    Layer 3: audit locale coverage

    This is the layer that answers the actual question. Intlayer ships it as a CLI command:

    bash
    npx intlayer content test
    

    It reads your configured locales and declared dictionaries, then reports which keys are missing which locales, and in which file.

    One detail worth knowing before you wire it into anything: the CLI prints a report but does not exit non-zero on failure. If you drop it into a pipeline expecting a red build, you will get a green one with a wall of text nobody reads. For gating, use the programmatic API instead, covered below.

    Layer 4: assert it in the test suite

    listMissingTranslations() gives you the same audit as data, which is what you want for a build gate.

    i18n.test.ts
    /* @vitest-environment node */
    import { listMissingTranslations } from "intlayer/cli";
    import { describe, expect, it } from "vitest";
    
    describe("translations", () => {
      it("has no missing required locales", async () => {
        const result = await listMissingTranslations();
    
        if (result.missingRequiredLocales.length > 0) {
          console.log(result.missingTranslations);
        }
    
        expect(result.missingRequiredLocales).toHaveLength(0);
      });
    });
    

    Three fields come back, and the distinction matters:

    • missingTranslations: per key, which locales are missing and from which file. This is what you print when the test fails.
    • missingLocales: the union across every key.
    • missingRequiredLocales: restricted to requiredLocales in your config, or all locales if you have not set it.

    Required locales are the useful knob

    Shipping eighteen locales does not mean all eighteen must be complete to deploy. Most teams have a tier that blocks a release and a tier that is best-effort.

    intlayer.config.ts
    import { Locales, type IntlayerConfig } from "intlayer";
    
    const config: IntlayerConfig = {
      internationalization: {
        locales: [
          Locales.ENGLISH,
          Locales.FRENCH,
          Locales.JAPANESE,
          Locales.POLISH,
        ],
        requiredLocales: [Locales.ENGLISH, Locales.FRENCH],
        defaultLocale: Locales.ENGLISH,
      },
    };
    
    export default config;
    

    Without requiredLocales, every declared locale is required and your build stays red until the last language lands. That is usually how teams end up disabling the check entirely, which is worse than not having it.

    Finding the ones already in production

    The layers above prevent new gaps. For an app that already shipped, two things help.

    Pseudolocalisation. Run a locale where every string is transformed, for example [!!! Ĉĥéçķöũţ !!!]. Anything rendering in plain English is hardcoded. It finds in ten minutes what a catalogue audit structurally cannot see, because it tests the rendered page rather than the catalogue.

    Crawl your own site. If you serve localised URLs, fetch a sample per locale and grep the HTML for your default-language strings. A page in /ja/ containing "Add to cart" is either a missing translation or a fallback you did not know about.

    bash
    curl -s https://example.com/ja/checkout | grep -c "Add to cart"
    

    Filling the gaps

    Once you know what is missing, intlayer fill populates the empty entries, and the autoFill option can generate per-locale files as content is declared. See autoFill.

    Worth being clear-eyed about this: machine-filled translations turn a visible gap into an invisible one. The key now has a value, so the audit goes green, and nobody reviews the wording. Use it to unblock a release, then route the output through a human for anything a customer reads before deciding. It is a scaffold, not an answer.

    Common mistakes

    • Treating fallback as a feature. It is a rendering strategy, not a safety net. A silent English page is a bug that reports itself to nobody.
    • Relying on the CLI report to gate CI. intlayer content test exits zero regardless. Assert in a test.
    • Requiring every locale. The check gets disabled the first time a release is blocked by a half-finished language.
    • Auditing catalogues but never the rendered page. Hardcoded strings are invisible to a catalogue audit by definition.
    • Checking only the default locale in tests. That is the one locale that cannot be missing.
    • Letting machine fill close the loop. Green audit, unreviewed copy.

    Going further

    Comments

    No comments yet. Be the first to share your thoughts.

    Related Posts

    Last Posts