-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Allow partial string replacement in package.json/package.nls.json, to ease translations of strings containing markdown #125774
Comments
The specific solution I suggested may not be the best. Generally, translators need to see a full sentence to localize it properly. Perhaps there could be some sort of syntax to allow string literals to be added to localized strings? Perhaps:
And in package.nls.json:
Though, one issue we have is that translators have been adding a space between the "]" and "(" in markdown links. However, we want translators to be able to localize the title part of the markdown link. Perhaps:
And in package.nls.json:
|
We should support this the same way as we support place holders in the nls.localize call. So place holders should be denoted using |
There were "pings to the loc team" by @sean-mcmanus and references to this issue - is it still open / "on deck"? |
@GitMensch I'm not sure what "pings" you're referring to. Our team is still hitting problems in which the translators are breaking our markdown strings on a widespread basis, leading to like 50+ separate loc bugs having to be filed. So we'd like to be able to use |
Adding @TylerLeonhardt since he know owns translation. @TylerLeonhardt I can assist with this if necessary. |
Within Microsoft OneLoc, you can add a comment: So we do this: With that said, I do think there is room for improvement in the tooling space here..... I'm just not sure which direction to take since this magical locked syntax is likely Microsoft OneLoc specific. |
Currently, various strings in package.json can be replaced with keys that refer to strings in package.nls.json. This enables localization of those strings (using vscode-nls and vscode-nls-dev, which generates package.*.nls.json for each language translation.)
Currently, only whole string replacement is supported. For example:
In package.json:
"description": "%key%"
In package.nls.json:
"key": "description string"
... works as expected. However using the following in package.json does not:
"description": "blah %key% blah"
... The resulting string is:
blah %key% blah
.This is a request to support this scenario, and resolve this string as
blah description string blah
.We have some strings that contain markdown. (i.e. strings passed to
markdownDescription
properties). However, our localization team is not necessary savvy with markdown. vscode-nls-dev has been updated to allow hints/comments to be specified in package.nls.json. However, indicating that a string contain markdown does not appear to have been sufficient to educate our localization team to avoid breaking the markdown syntax.This is a request to enable localization of markdown strings without corrupting the markdown, by allowing us to expose for localization only the portions of the strings that do not contain markdown. This seems a relatively simple fix, whereas having translators become proficient in markdown is not as simple.
The text was updated successfully, but these errors were encountered: