fix(i18n): preserve hierarchy so Crowdin sync targets the existing source file#3255
Conversation
…urce file Without preserve_hierarchy the Crowdin CLI flattens the source path to <branch>/en-US.json and forks a second, untranslated copy of every string instead of updating development/src/config/locales/en-US.json. That made the project report ~half its real translation progress. Keep the repo hierarchy so upload and download both resolve the existing translated file.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is a single well-understood Crowdin config flag with no runtime code impact. The change is one line in a YAML config file. The flag is the standard Crowdin mechanism for preserving directory structure, the workflows already supply the correct crowdin_branch_name, and the PR description confirms the Crowdin-side reconciliation has been done. There is no logic to break and no ambiguity in how the option behaves. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Repo as GitHub Repo
participant Action as crowdin/github-action@v2
participant CLI as Crowdin CLI
participant CrowdinProject as Crowdin Project
Note over CLI,CrowdinProject: Before fix (preserve_hierarchy: false)
Repo->>Action: push to development (en-US.json changed)
Action->>CLI: "upload_sources with branch=development"
CLI->>CrowdinProject: upload to development/en-US.json (flattened)
CrowdinProject-->>CLI: creates duplicate file
Note over CrowdinProject: Two copies exist — progress halved
Note over CLI,CrowdinProject: After fix (preserve_hierarchy: true)
Repo->>Action: push to development (en-US.json changed)
Action->>CLI: "upload_sources with branch=development"
CLI->>CrowdinProject: upload to development/src/config/locales/en-US.json
CrowdinProject-->>CLI: updates existing translated source file
Note over CrowdinProject: Single canonical file — correct progress
Repo->>Action: sync-translations label / workflow_dispatch
Action->>CLI: "download_translations with branch=development"
CLI->>CrowdinProject: download from development/src/config/locales/
CrowdinProject-->>CLI: returns locale files
CLI->>Repo: PR with updated translation files
Reviews (1): Last reviewed commit: "fix(i18n): preserve hierarchy so Crowdin..." | Re-trigger Greptile |
Problem
The Crowdin upload/download workflows run the CLI without
preserve_hierarchy, so the source pathsrc/config/locales/en-US.jsongets flattened to<branch>/en-US.json. Because the project's real, fully-translated source file lives atdevelopment/src/config/locales/en-US.json, the flattened upload didn't update it — it forked a second, empty copy of every string.Crowdin then counted both copies, so the project reported roughly half its true translation progress, and a download in that state could have pulled the empty copy over the translated locale files.
Fix
Set
preserve_hierarchy: trueincrowdin.ymlso both upload and download keep the repo path under the branch and resolve the existing source file. One line; no workflow changes needed (the action reads this config).The Crowdin side has been reconciled separately (duplicate file removed, source re-synced); after this merges, a normal
sync-translationsrun will batch the up-to-date translations back into the repo.