Polyglot Parrot re-translates every key under a parent object when the added key uses a computed property name

Aperta
#105,936 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start with extractKeyFromPropertyNode and buildDotNotationPath in scripts/utils/TSCompilerUtils.ts, then inspect the translation workflow logs cited in the issue to confirm how changed paths are built. Trace how computed property names using CONST.NEXT_STEP.MESSAGE_KEY.* map to their constant values. Done when the workflow identifies only the added key and avoids re-translating sibling keys under nextStep.message.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

PR https://github.com/Expensify/App/pull/104973 added one new English string to src/languages/en.ts:

[CONST.NEXT_STEP.MESSAGE_KEY.APPROVE_ONLY_SUBMIT_BLOCKED]: ...

The Polyglot Parrot bot then produced a 118KB translation patch that re-translated all 16 keys under nextStep.message in all 10 languages. Most of those strings were already translated, so the patch mostly reworded them (one German string even got a zero-width space added).

Why it happens

The new key uses a computed property name, so the path builder cannot name it and falls back to the parent object:

The bot marks the whole nextStep.message object as changed and re-translates every key under it.

Evidence

Workflow run https://github.com/Expensify/App/actions/runs/41727931903 logs the wrong path:

🔄 Found changed path: nextStep.message
🔄 Paths to modify: nextStep.message

It should have been only the new key.

Suggested fix

Teach extractKeyFromPropertyNode to resolve computed keys of the form [CONST.NEXT_STEP.MESSAGE_KEY.SOMETHING] to the constant value they point to. Then the changed path points at the single new key, and the bot re-translates only that key.

Same symptom was reported before in https://github.com/Expensify/App/issues/80978, which was closed without this root cause.

Lingua principale
TypeScript
Stelle
5k
Fork
4k
Merge medio
3g 2h
PR unite (30g)
617

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Expensify/App

Tutte le issue di Expensify/App

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.