Skip to content

fix(i18n): preserve hierarchy so Crowdin sync targets the existing source file#3255

Merged
feruzm merged 1 commit into
developmentfrom
chore/crowdin-preserve-hierarchy
Jun 14, 2026
Merged

fix(i18n): preserve hierarchy so Crowdin sync targets the existing source file#3255
feruzm merged 1 commit into
developmentfrom
chore/crowdin-preserve-hierarchy

Conversation

@feruzm

@feruzm feruzm commented Jun 14, 2026

Copy link
Copy Markdown
Member

Problem

The Crowdin upload/download workflows run the CLI without preserve_hierarchy, so the source path src/config/locales/en-US.json gets flattened to <branch>/en-US.json. Because the project's real, fully-translated source file lives at development/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: true in crowdin.yml so 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-translations run will batch the up-to-date translations back into the repo.

…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-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds preserve_hierarchy: true to crowdin.yml so the Crowdin CLI keeps the full repository path (development/src/config/locales/en-US.json) when resolving files, instead of flattening it to <branch>/en-US.json and inadvertently forking a second untranslated copy.

  • Adds a single preserve_hierarchy: true line to crowdin.yml with explanatory comments; no workflow changes are needed since crowdin/github-action@v2 reads this config automatically.
  • Both the upload (crowdin-upload.yml) and download (crowdin-download.yml) workflows already specify crowdin_branch_name: development, so they will correctly resolve to the fully-translated source file once this setting is in place.

Confidence Score: 5/5

Safe 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

Filename Overview
crowdin.yml Adds preserve_hierarchy: true so the Crowdin CLI maps the source file to development/src/config/locales/en-US.json instead of flattening it to development/en-US.json, preventing duplicate file creation on Crowdin.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "fix(i18n): preserve hierarchy so Crowdin..." | Re-trigger Greptile

@feruzm feruzm merged commit 4545f78 into development Jun 14, 2026
8 checks passed
@feruzm feruzm deleted the chore/crowdin-preserve-hierarchy branch June 14, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant