Skip to content

fix missing i18n messages in IDE menu #2215

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

Closed
wants to merge 2 commits into from
Closed

Conversation

coby2023t
Copy link
Contributor

Motivation

fix missing i18n messages in IDE menu, like Save

Copy link
Contributor

@per1234 per1234 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 pull request @coby2023t.

Arduino only maintains translations for the strings that are unique to Arduino IDE. All the strings that come from the Eclipse Theia framework Arduino IDE is built on are localized using VS Code language pack extensions.

For example, you can see the translations for the "Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code" language pack here:

https://github.com/microsoft/vscode-loc/tree/289bf47811a304b8dff152427c1df82c0f09c96a/i18n/vscode-language-pack-zh-hans/translations

If we add localization data to this repository for strings that have already been localized in the language pack, that would make unnecessary work for the community members who contribute translations to the Arduino IDE project.

I do confirm that there was a regression in the localization of the File > Save menu item. I bisected the regression to 192aac5, where the language packs were bumped from 1.53.2 to 1.70.0.

The localization data key for the menu item is set here:

label: nls.localize('vscode/fileCommands/save', 'Save'),

Using the zh-hans locale as an example, the data is here in version 1.53.2 of the language pack:

https://github.com/microsoft/vscode-loc/blob/295dfb35491adc41df4b89e0d839086131a34257/i18n/vscode-language-pack-zh-hans/translations/main.i18n.json#L5000

		"vs/workbench/contrib/files/browser/fileCommands": {
			"saveAs": "另存为...",
			"save": "保存",

Without explanation, the data was moved in the language packs from vs/workbench/contrib/files/browser/fileCommands/save to vs/workbench/contrib/files/browser/fileConstants/save by microsoft/vscode-loc@e36740c

https://github.com/microsoft/vscode-loc/blob/a51eba0bb6e14e9b26cb7b5fed1aeca520552010/i18n/vscode-language-pack-zh-hans/translations/main.i18n.json#L6189

		"vs/workbench/contrib/files/browser/fileCommands": {
			"discard": "放弃",
			"genericRevertError": "未能还原“{0}”: {1}",
			"genericSaveError": "未能保存“{0}”: {1}",
			"modifiedLabel": "{0} (在文件中) ↔ {1}",
			"retry": "重试"
		},
		"vs/workbench/contrib/files/browser/fileConstants": {
			"newUntitledFile": "新的无标题文件",
			"removeFolderFromWorkspace": "将文件夹从工作区删除",
			"save": "保存",

It would be better to adjust the Arduino IDE internationalization code for the breaking change in the language pack API instead of adding the string to the Arduino IDE localization data.

If other regressions were caused by the breaking changes, then the same type of proper fix can be made for them as well.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Sep 3, 2023
@per1234 per1234 mentioned this pull request Sep 3, 2023
3 tasks
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 5, 2023
@per1234 per1234 closed this Sep 5, 2023
@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants