Closed Cosifne closed 1 year ago
Tag @TylerLeonhardt to help
I just tried this and I can't repro:
package.nls.json:
{
"generateOptionsSchema.symbolOptions.searchMicrosoftSymbolServer.description": {
"message": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
"comment": [
"We use '\u200b' (unicode zero-length space character) to break VS Code's URL detection regex for URLs that are examples. Please do not translate or localized the URL.",
"{Locked='(https\u200b://msdl.microsoft.com\u200b/download/symbols)'}"
]
}
}
Command output:
>> npx @vscode/l10n-dev@latest generate-xlf ./package.nls.json -o foo.xlf
Searching for L10N JSON files...
Found 1 L10N JSON files. Generating XLF...
Wrote XLF file to: foo.xlf
Resulting XLF:
Raw XLF if you want to copy and verify yourself:
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="package" source-language="en" datatype="plaintext"><body>
<trans-unit id="generateOptionsSchema.symbolOptions.searchMicrosoftSymbolServer.description">
<source xml:lang="en">If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.</source>
<note>We use '' (unicode zero-length space character) to break VS Code's URL detection regex for URLs that are examples. Please do not translate or localized the URL.
{Locked='(https://msdl.microsoft.com/download/symbols)'}</note>
</trans-unit>
</body></file>
</xliff>
Are you able to repro this locally?
Ah I just checked the loc content looks like it is actually perserved. (Just Github doesn't show it in the PR) Close this issue. Thanks Tyler!
We have links need translated like https://github.com/dotnet/vscode-csharp/blob/a62858ca0eaaf750d3aff17c87e52d4ca779891b/package.nls.json#L248 includes
\u200b
However, when I rungenerate-xlf
,\u200b
is not reserved in the xlf files.This is causing the localization engine to remove
\u200b
from the link. https://github.com/dotnet/vscode-csharp/pull/6388/files Is there any way to keep the character