# Localization reuse  -  a shared catalogue's key is reused before a new one is minted

> **TLDR**  -  When a repo's localization keys are generated from a source shared with other platforms, a key another platform already added is THE key for that text. Phase 2 searches the shared source by key name and by display text before naming a new key, reuses a match, and adds a missing key once, upstream. Called from `phases/phase-2-dev.md`; the stack toolkits carry the same rule in `reference/component/key-naming.md` for work outside a run.

## When the catalogue is shared

Any of these makes it shared:

- the localization tree is under a `generators[].output` or an `ownedPaths[].glob` in the repo profile (`features/repo-profile.md`),
- its files carry a generator stamp ("do not edit", "generated by"),
- a sync bot writes it,
- the dev-context step recorded a counterpart app repo built from the same designs (`_dev-context.md`).

With none of these, the app's own catalogue is the source and the platform's naming defaults (`conventions-defaults.md` C6) apply unchanged.

## Before a new key is named

1. **Search by key and by value.** Look for the key name AND for the exact display text, in the mirror and, when it is reachable, in the upstream source (the counterpart repo, or the source the generator's `input` names). The mirror lags the source by one sync, so a key the other platform added since may only be upstream.
2. **Found: reuse it.** Code against the accessor the key generates. A key found only upstream is still used and recorded in the agent log as `pending-sync: <key>`; it is never replaced by a local stand-in, which would become the duplicate this rule exists to prevent.
3. **Not found: add it once, upstream,** through the project's authoring flow, with a platform-neutral name, so the other platform finds it next time. The mirror and the generated files are never edited; the owned-path rule in Phase 2 already stops that edit.
4. **Names differ by platform convention: match on the value.** C6 spells the same key differently per platform; a text that already exists under another key is the same string, whatever the casing.

## Review

`platform-parity.md` check 4 flags a key the change adds whose display text another key already holds on either side.
