Skip to content

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

@edelauna

Description

@edelauna

Problem (one or two sentences)

The Code Action context menu labels ("Explain with Zoo Code", "Fix with Zoo Code", "Improve with Zoo Code", "Add to Zoo Code", "New Roo Code Task") are hardcoded English strings in src/activate/CodeActionProvider.ts. They bypass the project's existing NLS localization system, so users running VS Code in any non-English locale always see English text.

Context (who is affected and when)

Affects all users whose VS Code display language is not English, any time they use the Code Actions context menu (lightbulb / Cmd+.). Noticed during review of PR #329, which renamed the strings from Roo→Zoo but kept them hardcoded rather than routing them through the NLS system. That PR also missed one rename: NEW_TASK still reads "New Roo Code Task" instead of "New Zoo Code Task".

Desired behavior (conceptual, not technical)

Code Action menu labels should be translatable. They should be defined in src/package.nls.json (and the ~17 existing locale files) and looked up at runtime, the same way other user-facing strings in the extension are handled.

Constraints / preferences (optional)

  • The missed rename (NEW_TASK: "New Roo Code Task") should be fixed as part of this work.
  • Translation strings for the non-English locale files can be left as the English fallback initially; native speakers can follow up with accurate translations via separate PRs.

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Acceptance criteria (optional)

Given a VS Code instance running in a non-English locale (e.g. zh-CN)
When the user opens the Code Actions menu on a selection
Then the menu items are shown in the configured locale (or fall back to English gracefully)
And no label still reads "Roo Code"

Proposed approach (optional)

  1. Add NLS keys to src/package.nls.json, e.g.:
    • "codeAction.explain": "Explain with Zoo Code"
    • "codeAction.fix": "Fix with Zoo Code"
    • "codeAction.improve": "Improve with Zoo Code"
    • "codeAction.addToContext": "Add to Zoo Code"
    • "codeAction.newTask": "New Zoo Code Task"
  2. Add the same keys (with English fallback values) to each locale package.nls.*.json file so the lookup never fails.
  3. Replace the hardcoded strings in CodeActionProvider.ts with the appropriate NLS lookup.

Trade-offs / risks (optional)

Low risk — the NLS pattern is already established in the codebase. The only risk is missing a locale file, which would silently fall back to English (acceptable behaviour for VS Code extensions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions