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

Incorrect translation of marscode ai plugin: Regular expression does not support keys containing spaces #15093

Open
zhangzejun123 opened this issue Mar 3, 2025 · 2 comments

Comments

@zhangzejun123
Copy link

Bug Description:

There is an issue with the translation of the marscode ai plugin. After investigation, it was found that the problem lies in the regular expressions corresponding to lines 379 and 19 of the file @theia/plugin-ext/src/hosted/node/hosted-plugin-localization-service.ts. The current regular expression does not support keys containing spaces. However, the translation files of the marscode ai plugin contain keys with spaces, such as "%New Chat%", which will lead to incorrect matching.

Specific Behavior

In the Theia environment, when using this regular expression to match keys with spaces, the translation placeholders cannot be parsed correctly. But in VS Code, the same translation files and placeholders can be parsed normally.

Relevant Code

The regular expression involved in the problem may be similar to the following code:

typescript const NLS_REGEX = /^%([\w\d.-]+)%$/i;

Image

Steps to Reproduce:

  1. Install the marscode ai plugin in the Theia environment.
    2.Check the translation files containing keys with spaces (e.g., %New Chat%).
  2. Try to load the plugin and view the translation results. You will find that the translation of keys with spaces is incorrect.

Additional Information

  • Operating System: windows 10
  • Theia Version: 1.58.3
@zhangzejun123
Copy link
Author

zhangzejun123 commented Mar 3, 2025

This is the translation file of Marscode AI.

Image

@JonasHelming
Copy link
Contributor

@msujew

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

No branches or pull requests

2 participants