Repository navigation
feat: ignore keys only for selected target locales (1.9.0) - #83
Merged
Merged
Conversation
ignoredKeys entries can now be an object { path, locales } to ignore a key
only for the listed target locales. Plain string entries keep applying to
every target locale, and both forms can be mixed.
- Schema: union of KeyPath and { path, locales }; a locale not in
locales.target is a config error (catches typos such as de vs de-DE).
Entries are not transformed, so commands that rewrite lara.yaml keep the
user's syntax.
- Engine: isIgnored() takes the target locale being processed.
- Tests: schema tests, config round-trip, a 3-phase multi-locale scenario
for all 10 formats, and JSON edge cases (mixed rules, source deletion,
includeKeys, --target, invalid config).
- Docs: per-language ignored keys section in docs/config/files.md.
- Version bumped to 1.9.0 (package.json and README badge).
Khalester
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ignoredKeysapplied to every target locale, so there was no way to ignore a key for only some languages. Entries can now be an object that lists the target locales it applies to:For the listed locales the key behaves exactly like an ignored key today: an existing target value is preserved as-is, a missing one is not added. Other locales translate it normally.
Changes
src/modules/config/config.types.ts):ignoredKeysaccepts a key pattern or{ path, locales }, withlocalesa non-empty list of valid locales. A locale not inlocales.targetis a config error pointing at the entry, e.g.files.json.ignoredKeys.1.locales: Locale "de" is not a target locale (add it to locales.target or remove it from this rule).This catches typos like
devsde-DE, which would otherwise silently translate the key. Entries are not transformed while parsing, somemory/glossarycommands that rewritelara.yamlkeep the user's syntax.src/modules/translation/translation.engine.ts):isIgnored()takes the target locale being processed. The per-locale loop already existed.docs/config/files.md, example indocs/config/structure.md.package.jsonand the README badge (the badge was still at 1.7.3).glossary.ts,memory.ts,error.ts, which already failedformat:checkon main. Formatting only, no logic changes.Tests
Schema: string, object and mixed forms; rejection of empty
locales, missing fields, unknown codes, non-target and source locales, with the exact issue path.Config round-trip:
addIdToConfigkeeps the{ path, locales }form.All 10 formats: a 3-phase scenario with several targets.
For single-file formats (i18n.ts, Vue, .xcstrings) it also checks the source string survives.
JSON edge cases: mixed global and per-locale rules, no API call for ignored locales, key deleted from source (removed in it, kept in fr),
includeKeys,--target, invalid config.Mutation check: making the rule apply to all locales, or to none, fails 15 tests each; removing the locale validation fails 4.
pnpm test(1032 tests),build,lintandformat:checkare clean.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.