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

Multiline Comments Issue #77

Closed
TylerLeonhardt opened this issue Jan 12, 2023 · 0 comments · Fixed by microsoft/vscode#171125
Closed

Multiline Comments Issue #77

TylerLeonhardt opened this issue Jan 12, 2023 · 0 comments · Fixed by microsoft/vscode#171125

Comments

@TylerLeonhardt
Copy link
Member

Multiline Comments:

Running npx @vscode/l10n-dev export on

const comment = vscode.l10n.t(
{
  message: "string with multiple comments",
  comment: [
	"comment 1",
	"comment 2",
	"comment 3"
  ]
});
vscode.window.showInformationMessage(comment);

produces a bundle.l10n.json with

{
  "string with multiple comments/comment 1comment 2comment 3": {
    "message": "string with multiple comments",
    "comment": [
      "comment 1",
      "comment 2",
      "comment 3"
    ]
  }
}

note that the lookup key contains all three lines of comments, but has no marker separating the comment lines.
Copying this value into a translated bundle.l10n.*.json with a fake translation like

{
    "string with multiple comments/comment 1comment 2comment 3": "FAKE TRANSLATION - string with multiple comments"
}

causes a lookup miss at runtime, loading the untranslated English default text.

TylerLeonhardt added a commit to microsoft/vscode that referenced this issue Jan 12, 2023
This should have been the case all along, but I missed it and probably thought not passing anything joins with empty string.

fixes microsoft/vscode-l10n#77
TylerLeonhardt added a commit to microsoft/vscode that referenced this issue Jan 12, 2023
This should have been the case all along, but I missed it and probably thought not passing anything joins with empty string.

fixes microsoft/vscode-l10n#77
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

Successfully merging a pull request may close this issue.

1 participant