Description
There is an inconsistency between:
The CLI docs currently say that --strict will:
Fail if a catalog has missing translations.
At the same time, the config docs say that fallbackLocales are used when a translation for a locale is missing.
Today these two concepts do not line up clearly:
lingui extract reports Missing based on raw catalog entries with empty translations
lingui compile --strict appears to validate the resolved result after fallbacks are applied
Because of that, a locale can still show Missing > 0 in extract stats, while lingui compile --strict exits successfully.
This is especially confusing in CI for teams that:
- use
fallbackLocales at runtime
- still want to fail builds until each locale catalog is fully translated
Related but distinct from #2195: that issue asks for a dedicated check command without writing files. This issue is about the current semantic mismatch between documented strict-mode behavior and what the CLI actually validates.
Verifications
Reproduction Steps
Documentation references:
lingui.config.js
export default {
locales: ["en-US", "en-GB"],
sourceLocale: "en-US",
fallbackLocales: {
default: "en-US",
},
catalogs: [
{
path: "<rootDir>/{locale}",
include: ["<rootDir>"],
exclude: [],
},
],
}
en-US.po
msgid "Hello"
msgstr "Hello"
en-GB.po
Run:
Result:
Catalog statistics for {locale}:
┌────────────────┬─────────────┬─────────┐
│ Language │ Total count │ Missing │
├────────────────┼─────────────┼─────────┤
│ en-US (source) │ 1 │ - │
│ en-GB │ 1 │ 1 │
└────────────────┴─────────────┴─────────┘
Then run:
Current result:
Compiling message catalogs…
Done in <n>ms
The process exits with code 0.
Expected Behavior
The current behavior should be clarified or changed so that the semantics are consistent.
One of these should happen:
lingui compile --strict should fail when locale catalogs still contain raw missing translations, matching the Missing counts reported by lingui extract.
- If
lingui compile --strict is intentionally defined as "fail only after fallback resolution", the docs should say that explicitly, because the current --strict wording reads much broader.
Without that clarification, extract and compile --strict suggest different answers to the question "does this locale still have missing translations?"
Macro Support
Not using macro
Lingui Version
@lingui/cli 6.0.0-next.3 (current repository state)
Babel Version
N/A
Framework
CLI only / no framework
Description
There is an inconsistency between:
Missingcounts reported bylingui extractlingui compile --strictfallbackLocalesare configuredThe CLI docs currently say that
--strictwill:At the same time, the config docs say that
fallbackLocalesare used when a translation for a locale is missing.Today these two concepts do not line up clearly:
lingui extractreportsMissingbased on raw catalog entries with empty translationslingui compile --strictappears to validate the resolved result after fallbacks are appliedBecause of that, a locale can still show
Missing > 0in extract stats, whilelingui compile --strictexits successfully.This is especially confusing in CI for teams that:
fallbackLocalesat runtimeRelated but distinct from #2195: that issue asks for a dedicated check command without writing files. This issue is about the current semantic mismatch between documented strict-mode behavior and what the CLI actually validates.
Verifications
Reproduction Steps
Documentation references:
fallbackLocales: https://lingui.dev/ref/conf#fallbacklocalessourceLocale: https://lingui.dev/ref/conf#sourcelocalelingui.config.jsen-US.poen-GB.poRun:
Result:
Then run:
Current result:
The process exits with code
0.Expected Behavior
The current behavior should be clarified or changed so that the semantics are consistent.
One of these should happen:
lingui compile --strictshould fail when locale catalogs still contain raw missing translations, matching theMissingcounts reported bylingui extract.lingui compile --strictis intentionally defined as "fail only after fallback resolution", the docs should say that explicitly, because the current--strictwording reads much broader.Without that clarification,
extractandcompile --strictsuggest different answers to the question "does this locale still have missing translations?"Macro Support
Not using macro
Lingui Version
@lingui/cli6.0.0-next.3(current repository state)Babel Version
N/A
Framework
CLI only / no framework