Skip to content

feat: localize code action commands#339

Merged
taltas merged 2 commits into
Zoo-Code-Org:mainfrom
rrewll:feat/334-code-action-localization
May 27, 2026
Merged

feat: localize code action commands#339
taltas merged 2 commits into
Zoo-Code-Org:mainfrom
rrewll:feat/334-code-action-localization

Conversation

@rrewll
Copy link
Copy Markdown
Contributor

@rrewll rrewll commented May 26, 2026

Related GitHub Issue

Closes: #334

Description

Support localization for code action commands.

Test Procedure

  1. Open VS Code.
  2. Zoo Code -> Settings -> Language -> Select another language (e.g. Espanol) -> Save
  3. Select a code and call the code action menu (click to the bulb or press Cmd+. / Ctrl+.)
  4. You should see localized Zoo Code specific action items. For example: "Añadir a Zoo Code" (add to), "Explicar con Zoo Code" (explain with) and "Mejorar con Zoo Code" (improve with).

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

English version:
code-action-context-menu-2

Localized version:
Screenshot — 2026-05-26 в 23 24 10

English version:
new-code-action-context-menu-1

Localized version:
Screenshot — 2026-05-26 в 23 25 12

Summary by CodeRabbit

  • Internationalization
    • Code action titles now display in 15+ languages including Catalan, German, Spanish, French, Hindi, Indonesian, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Turkish, Vietnamese, and Chinese.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fbee7454-b466-4aee-93b7-d61ff2dc5988

📥 Commits

Reviewing files that changed from the base of the PR and between cef0cc3 and be6de7d.

📒 Files selected for processing (20)
  • src/activate/CodeActionProvider.ts
  • src/activate/__tests__/CodeActionProvider.spec.ts
  • src/i18n/locales/ca/common.json
  • src/i18n/locales/de/common.json
  • src/i18n/locales/en/common.json
  • src/i18n/locales/es/common.json
  • src/i18n/locales/fr/common.json
  • src/i18n/locales/hi/common.json
  • src/i18n/locales/id/common.json
  • src/i18n/locales/it/common.json
  • src/i18n/locales/ja/common.json
  • src/i18n/locales/ko/common.json
  • src/i18n/locales/nl/common.json
  • src/i18n/locales/pl/common.json
  • src/i18n/locales/pt-BR/common.json
  • src/i18n/locales/ru/common.json
  • src/i18n/locales/tr/common.json
  • src/i18n/locales/vi/common.json
  • src/i18n/locales/zh-CN/common.json
  • src/i18n/locales/zh-TW/common.json

📝 Walkthrough

Walkthrough

Code action titles in the extension are migrated from hardcoded English strings to i18n-localized labels. CodeActionProvider.ts now calls t("common:codeActions.*") for four action types, the TITLES constant is removed, and translation strings are added across all 18 supported locales.

Changes

Code Action i18n Localization

Layer / File(s) Summary
Provider implementation and i18n wiring
src/activate/CodeActionProvider.ts
The provider drops the exported TITLES constant, imports the i18n t function, and rewires all four code action creation calls (addToContext, fix, explain, improve) to pass localized titles from t("common:codeActions.*") instead of TITLES references.
Test mock and assertions
src/activate/__tests__/CodeActionProvider.spec.ts
Tests mock the i18n module to return English "Zoo Code" strings and update all expected-title assertions to verify both the default action set and the diagnostics-present action set match the localized values.
Localization strings across all locales
src/i18n/locales/**/common.json
All 18 locale files are updated with a new codeActions object containing localized labels for explain, fix, improve, and addToContext in Catalan, German, English, Spanish, French, Hindi, Indonesian, Italian, Japanese, Korean, Dutch, Polish, Portuguese (BR), Russian, Turkish, Vietnamese, Chinese (Simplified), and Chinese (Traditional).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#329: Renamed code action titles from "Roo Code" to "Zoo Code" in the same provider file; this PR completes the migration to i18n for those titles.

Suggested reviewers

  • taltas
  • hannesrudolph
  • JamesRobert20
  • edelauna
  • navedmerchant

Poem

🐰 Code actions now speak every tongue,
From English strings, i18n won!
Zoo translates to all lands near and far,
A localized extension, shining star! 🌍

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: localize code action commands' clearly and concisely describes the main change: implementing localization for code action command titles.
Description check ✅ Passed The PR description is comprehensive and follows the template well: it links to issue #334, explains implementation details, provides clear test procedures with screenshots, and includes a completed pre-submission checklist.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #334: code action titles now use i18n localization via the t() function instead of hardcoded strings, translations are added across 17 locale files, and the corresponding test mocks are updated [#334].
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #334: CodeActionProvider.ts refactored to use i18n, test mocks updated accordingly, and localization files added for all existing locales. No unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/activate/CodeActionProvider.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/activate/__tests__/CodeActionProvider.spec.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rrewll rrewll marked this pull request as ready for review May 26, 2026 20:55
Copy link
Copy Markdown
Contributor

@taltas taltas left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, there are always more corners to translate!

@taltas taltas added this pull request to the merge queue May 27, 2026
Merged via the queue into Zoo-Code-Org:main with commit e27a42b May 27, 2026
16 checks passed
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.

[ENHANCEMENT] CodeActionProvider titles should use NLS localization instead of hardcoded English strings

2 participants