Skip to content

i18n: localize the About window update section + Crowdin sync#275

Open
AprilNEA wants to merge 1 commit into
masterfrom
feat/about-window-i18n
Open

i18n: localize the About window update section + Crowdin sync#275
AprilNEA wants to merge 1 commit into
masterfrom
feat/about-window-i18n

Conversation

@AprilNEA

@AprilNEA AprilNEA commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Routes the About window's update-status strings (Checking, Available, Downloading, Installing, Staged, Errored, plus the action labels and footer links) through tr! and adds their keys to all 20 locale files. Adds the Crowdin sync workflow that keeps the non-English locales in step with en.yml.

Also fixes an implicit_clone clippy lint on the Errored arm in passing.

Notes

Route the About window's update-status strings (Checking, Available,
Downloading, Installing, Staged, Errored, plus the action labels and
footer links) through tr! and add their keys to all 20 locale files. Adds
the Crowdin sync workflow that keeps the non-English locales in step with
en.yml.

(Fixes an implicit_clone clippy lint on the Errored arm in passing.)
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR routes all About-window update-status strings through tr!, adds the 14 new i18n keys to all 20 locale files, and introduces a Crowdin sync workflow on a daily schedule plus push-to-master triggers.

  • about.rs: All hardcoded update-status labels (Checking, Available, Downloading, Installing, Staged, Errored) and footer strings are now localized via tr!. Interpolation for version, percent, size, and error fields is correctly forwarded. The implicit_clone lint on the Errored arm is fixed with an explicit .clone().
  • Locale files: All 20 locale files gain the same 14 keys in key-parity; interpolation placeholders are preserved across all translations.
  • Crowdin workflow: Daily cron + push-to-en.yml trigger creates a PR against crowdin/i18n to pull updated machine translations; however, the generated PR body references a non-existent export_languages key as the mechanism that limits language scope (see inline comment).

Confidence Score: 4/5

The Rust code and locale files are clean; the only concern is in the new Crowdin workflow configuration.

The about.rs changes and all 20 locale files are straightforward and correct. The Crowdin workflow will function for the 6 mapped languages, but its PR body template misleadingly cites export_languages as the scope guard when that key is absent — and without it, the action may download and commit translations for unmapped locales under unexpected filenames when the Crowdin project grows.

.github/workflows/crowdin.yml — the export_languages key and action SHA-pinning warrant attention before the workflow runs in production.

Security Review

  • crowdin/github-action@v2 and actions/checkout@v4 are pinned to mutable version tags in a workflow that holds contents: write and pull-requests: write permissions. Supply-chain compromise of either tag would allow arbitrary code execution with those permissions.

Important Files Changed

Filename Overview
.github/workflows/crowdin.yml New Crowdin sync workflow; the PR body template references a non-existent export_languages key to describe language filtering, and actions are pinned to mutable tags despite having write permissions.
crates/openlogi-gui/src/windows/about.rs All update-status strings and action button labels routed through tr!; implicit_clone lint on the Errored arm fixed with .clone(). Logic is correct.
crates/openlogi-gui/locales/en.yml 14 new i18n keys added for update-status strings and footer links; all keys are consistent with how they are called in about.rs.
crates/openlogi-gui/locales/da.yml 14 new translation keys added; all interpolation placeholders preserved correctly.
crates/openlogi-gui/locales/zh-CN.yml 14 new translation keys added; full-width colon used appropriately in Chinese error string.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Push to master\n(en.yml / crowdin.yml changed)"] --> B[crowdin.yml workflow]
    C["Daily cron\n(03:17 UTC)"] --> B
    D[workflow_dispatch] --> B
    B --> E["Upload source\n(en.yml → Crowdin)"]
    E --> F["Download translations\n(all Crowdin languages)"]
    F --> G{"In languages_mapping?"}
    G -- "yes (ja,ru,zh-CN,zh-HK,zh-TW,it)" --> H["File written with\nmapped locale code"]
    G -- "no (14 other locales)" --> I["File written with\nCrowdin native code\n(may differ from existing files)"]
    H --> J["Commit to crowdin/i18n branch"]
    I --> J
    J --> K["Open / update PR\nagainst master"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["Push to master\n(en.yml / crowdin.yml changed)"] --> B[crowdin.yml workflow]
    C["Daily cron\n(03:17 UTC)"] --> B
    D[workflow_dispatch] --> B
    B --> E["Upload source\n(en.yml → Crowdin)"]
    E --> F["Download translations\n(all Crowdin languages)"]
    F --> G{"In languages_mapping?"}
    G -- "yes (ja,ru,zh-CN,zh-HK,zh-TW,it)" --> H["File written with\nmapped locale code"]
    G -- "no (14 other locales)" --> I["File written with\nCrowdin native code\n(may differ from existing files)"]
    H --> J["Commit to crowdin/i18n branch"]
    I --> J
    J --> K["Open / update PR\nagainst master"]
Loading

Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "i18n: localize the About window update s..." | Re-trigger Greptile

Comment on lines +50 to +53
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 export_languages key referenced in PR body but absent from crowdin.yml

The generated PR description claims "intentionally limited by export_languages in crowdin.yml", but the existing crowdin.yml has no export_languages key — only a languages_mapping covering 6 of the 20 locales. languages_mapping controls filename transformation, not which languages Crowdin downloads. Without export_languages, the action will attempt to download translations for every language present in the Crowdin project. For languages outside the mapping (da, de, el, es, fi, fr, ko, nb, nl, pl, pt-BR, pt-PT, sv), Crowdin falls back to its own locale codes, which could create wrong-named files (e.g. pt_BR.yml instead of pt-BR.yml) or silently overwrite the manually-maintained locales if the codes happen to match.

Fix in Codex Fix in Claude Code

upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: crowdin/i18n

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 security Actions pinned to mutable tags

Both actions/checkout@v4 and crowdin/github-action@v2 are referenced by mutable version tags. If either tag is re-pointed upstream, subsequent workflow runs will silently pick up the new commit. For a workflow that has contents: write and pull-requests: write permissions, pinning to an immutable SHA removes that exposure surface.

Fix in Codex Fix in Claude Code

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