Polyglot Parrot re-translates every key under a parent object when the added key uses a computed property name
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
- Ambito
- internationalization
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:
extractKeyFromPropertyNodereads only plain identifiers and string literals, so it cannot resolve a computed key like[CONST.NEXT_STEP.MESSAGE_KEY.APPROVE_ONLY_SUBMIT_BLOCKED]: https://github.com/Expensify/App/blob/f010565fbfe1ab28c96dc3595be2052c215aa8ae/scripts/utils/TSCompilerUtils.ts#L246buildDotNotationPaththen walks up to the nearest key it can name, which is the parentnextStep.message: https://github.com/Expensify/App/blob/f010565fbfe1ab28c96dc3595be2052c215aa8ae/scripts/utils/TSCompilerUtils.ts#L265
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Expensify/App
-
Monthly Not a priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Expensify/App#106225 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Monthly Not a priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Expensify/App#106221 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Exploratory] Expense - 2 selected drop-down is shown twice when selecting hold from more option.ApertaMonthly Not a priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Expensify/App#106080 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Monthly Not a priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Expensify/App#106057 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Reviewing Weekly
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Expensify/App#105383 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Expensify/App
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
area/admin/user area/internationalization automated-triage issue/auto-triaged type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
grafana/grafana#137281 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
Luen/crag-stats#429 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Missing assertions to legacy Cafe Menu block testsForse già presa @mariamanbar l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
freeCodeCamp/freeCodeCamp#71624 ·
I maintainer di solito rispondono entro 1 giorno