Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localize Theia AI strings #14857

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CamilleLetavernier
Copy link
Contributor

fixes #14825

What it does

  • Localize AI Agent Descriptions
  • Localize AI Preferences
  • Localize AI View Titles and Descriptions
  • Localize AI Commands and Menus

The following have NOT been localized:

  • Agent Names
    • I'm not sure which part of the Agent is used as a regular label, and which is used to actually call the @Agent; so I let agent Names as-is
  • React Contents
    • I'm not sure how to best provide localization for a mix of Text, HTML and overall React magic, so I skipped everything in *.tsx
  • Prompt Templates
    • This seems complicated and risky. Especially, a lot of Prompt Templates use JS-template strings with variables, so it would be a significant effort to localize properly
  • Errors/Warnings
  • Progress Messages

The PR only includes Typescript changes (nls.localize()). NLS files have not been updated, for any language.

How to test

The PR only introduces nls.localize() calls, so it can't immediately be tested. I'm not sure what is the best way to test the changes, but what I did:

  • Add (a subset of) the keys to your favorite language, in packages/core/i18n/nls.**.json

For example, in French:

"theia": {
    "ai": {
      "chatUi": {
        "attachToContext": "Ajouter des éléments au contexte",
        "cancel": "Annuler (Esc)",
        "removeChat": "Supprimer la conversation",
        "send": "Envoyer (Enter)"
      }
    },
  • Start Theia
  • In the Command Palette, call Configure Display Language and select the modified language
  • Restart Theia Frontend
  • Check that the localized messages properly appear

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

- Localize Agent Descriptions
- Localize Preferences
- Localize View Titles and Descriptions

fixes eclipse-theia#14825

Signed-off-by: Camille Letavernier <[email protected]>
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Looks great ❤️

The following have NOT been localized:

  • Agent Names
    • I'm not sure which part of the Agent is used as a regular label, and which is used to actually call the @Agent; so I let agent Names as-is
  • React Contents
    • I'm not sure how to best provide localization for a mix of Text, HTML and overall React magic, so I skipped everything in *.tsx
  • Prompt Templates
    • This seems complicated and risky. Especially, a lot of Prompt Templates use JS-template strings with variables, so it would be a significant effort to localize properly
  • Errors/Warnings
  • Progress Messages
  • Agent Names ✅
  • React contents ❌ This should be translatable see for example the about dialog. Can you point to some difficult places for localization?
  • Prompt Templates ✅
  • Errors/Warnings: ❔ should be translated if it's about errors in the UI. Errors/Warnings in the logs are fine
  • Progress Messages ❔ should be translated I think, is there a reason not to?

Please update to latest master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting on author
Development

Successfully merging this pull request may close these issues.

All Theia AI strings should be translatable
2 participants