Skip to content

feat(i18n): extract Chinese translations into dedicated JSON file#3549

Open
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:feat/i18n-localization
Open

feat(i18n): extract Chinese translations into dedicated JSON file#3549
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:feat/i18n-localization

Conversation

@cy2311

@cy2311 cy2311 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Extract Simplified Chinese translations from the hard-coded localization.rs (5385 lines) into a dedicated locales/zh-Hans.json file. This is Step 1 of the i18n refactoring proposed in issue #3537.

Changes

  • locales/zh-Hans.json (new) — 408 Chinese translation entries in standard JSON format
  • localization.rs — Reduced by 541 lines. The chinese_simplified() function now reads from zh-Hans.json at runtime

Next steps

  • Step 2: Extract remaining languages (ja, pt-BR, es-419, vi, zh-Hant)
  • Step 3: Consider adopting a formal i18n library (fluent-rs, rust-i18n)
  • Step 4: Add CI checks for missing translations

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Thanks @cy2311 for taking the time to contribute.

This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

@Hmbown

Hmbown commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Thanks again @cy2311. I harvested this into a current-main replacement PR so we can keep your dedicated zh-Hans.json direction without losing the newer localization coverage that landed after your branch diverged.

Replacement: #3559

What changed in the harvest:

  • preserves the crates/tui/locales/zh-Hans.json extraction, regenerated to cover all current shipped MessageIds
  • keeps your details-shortcut cleanup direction and finishes it so visible help/footer/context copy points to bare v rather than the old modified shortcut
  • keeps credit in the merge commit with Harvested from PR #3549 by @cy2311 and a co-author trailer

Verification on the harvest branch:

  • cargo fmt --all
  • cargo test -p codewhale-tui --bin codewhale-tui --locked localization::tests
  • cargo test -p codewhale-tui --bin codewhale-tui --locked tool_details_help_documents_bare_v_without_alt_v
  • cargo test -p codewhale-tui --bin codewhale-tui --locked activity_footer_hint
  • cargo test -p codewhale-tui --bin codewhale-tui --locked activity_detail
  • cargo test -p codewhale-tui --bin codewhale-tui --locked open_tool_details_pager

I will resolve this original conflicted PR after #3559 lands so the public queue points at the clean, credited path.

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.

2 participants