Polyglot Parrot re-translates every key under a parent object when the added key uses a computed property name
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- internationalization
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 4k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 594
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Expensify/App
-
[Exploratory] Expense - 2 selected drop-down is shown twice when selecting hold from more option.OpenMonthly Not a priority
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Expensify/App#106080 · 1 comment ·
Maintainers usually reply within 1 day
-
Monthly Not a priority
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Expensify/App#106057 · 1 comment ·
Maintainers usually reply within 1 day
-
Reviewing Weekly
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Expensify/App#105383 · 1 comment ·
Maintainers usually reply within 1 day
-
Monthly Not a priority
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Expensify/App#105341 · 2 comments ·
Maintainers usually reply within 1 day
-
Monthly Not a priority
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Expensify/App#105100 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Navbar avatar and name stay stale after saving profile changesPossibly taken @alexechoi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/atomic-crm#416 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epam/ai-dial-react-file-manager#99 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
canonical/craft-actions#146 ·
Maintainers usually reply within 2 days
-
feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bluesky-social/social-app#12343 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lucide-icons/lucide#5165 ·
Maintainers usually reply within 1 day