Skip to content

Preserve & parity policies

Preserve and parity rules live in apps/web/i18nprune.config.ts under policies (not in removed scripts/locales/shared/preserve.ts).

policies.preserve

  • copyPrefixes — keys under these prefixes are copied verbatim from English during generate and protected during cleanup/sync when static analysis cannot prove usage (e.g. navigation.*, pages.domain.shared.settings.*).
  • copyKeys — explicit keys always copied verbatim (app.brand, common.dash, seo.titleTemplate).

policies.parity

Exclusions for source-identical quality checks (strings that are intentionally equal to English):

  • excludePrefixes — e.g. placeholder and export-dialog sections
  • excludeKeys — explicit keys (brand, format tokens)
  • excludeValues — literal values (em-dash, sample emails, template tokens)

reference.commands

Explicit safe defaults for write commands:

  • cleanup, sync, generateuncertainKeyPolicy: 'protect', respectPreserve: true

English safety

en.json is the source locale (locales.source: 'en'). i18nprune guards against deleting or cleaning the source file.

Read-only path-level reports

i18nprune quality returns counts. For actual identical paths per locale file, use native kits:

bash
cd apps/web
pnpm exec i18nprune kits identical -T 50
pnpm exec i18nprune kits identical -r -T 50   # ignore policies.parity excludes