Skip to content

Replace concatenated localize calls with single localize for gutter indicator menu#286693

Merged
benibenj merged 2 commits intomainfrom
copilot/fix-nls-concat-issue
Jan 26, 2026
Merged

Replace concatenated localize calls with single localize for gutter indicator menu#286693
benibenj merged 2 commits intomainfrom
copilot/fix-nls-concat-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 9, 2026

Localized strings should not be concatenated with hardcoded separators. Different languages may use different separators, word order, or phrasing entirely.

Before:

title: `${localize('goto', "Go To")} / ${localize('accept', "Accept")}`

After:

title: localize('gotoAndAccept', "Go To / Accept")

This allows translators to provide the appropriate phrasing for their language rather than being forced to use the English "Foo / Bar" pattern.

Original prompt

This section details on the original issue you should resolve

<issue_title>debt - don't do nls concat</issue_title>
<issue_description>Found this ⬇️. It's better to have a single nls/localize string and not hardcode the /-character. We don't know if all languages use the "Foo / Bar"

title: `${localize('goto', "Go To")} / ${localize('accept', "Accept")}`,
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix hardcoded character in nls string localization Replace concatenated localize calls with single localize for gutter indicator menu Jan 9, 2026
Copilot AI requested a review from benibenj January 9, 2026 09:49
@benibenj benibenj marked this pull request as ready for review January 26, 2026 17:09
Copilot AI review requested due to automatic review settings January 26, 2026 17:09
@benibenj benibenj enabled auto-merge (squash) January 26, 2026 17:09
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reworks the gutter indicator menu label localization to avoid concatenating multiple localize() calls with a hardcoded separator, allowing translators to control phrasing and separators appropriately.

Changes:

  • Replaced a template-literal concatenation of two localized strings ("Go To" and "Accept") with a single localized string ("Go To / Accept").

@benibenj benibenj merged commit ae2ed18 into main Jan 26, 2026
27 of 28 checks passed
@benibenj benibenj deleted the copilot/fix-nls-concat-issue branch January 26, 2026 17:47
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

debt - don't do nls concat

4 participants