microsoft / microsoft/vscode

Regression: Focus on <View> View commands are not searchable by English view name in localized UI

Open
#329,800 0 comments 0 reactions 1 assignee Claimed by @TylerLeonhardt View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Not tested

- VS Code Version: 1.132.0
- OS Version: macOS 26.5.2 (Apple Silicon)
- Display Language: Simplified Chinese

Steps to Reproduce:

1. Set the VS Code display language to Simplified Chinese.
2. Open the Command Palette.
3. Search for `Timeline`.
4. Observe that the command for focusing the Timeline view is not found.
5. Search for `时间线`.
6. Observe that `资源管理器: 焦点在 时间线 视图上` is found.

The command is displayed as:

```text
资源管理器: 焦点在 时间线 视图上
Explorer: Focus on 时间线 View
```

## Expected

The command should be searchable using either the localized view name or its original English name.

Its localized string should preserve both forms:

```text
value: "焦点在 时间线 视图上"
original: "Focus on Timeline View"
```

## Actual

The English `original` title contains the already-localized view name:

```text
value: "焦点在 时间线 视图上"
original: "Focus on 时间线 View"
```

As a result, searching for `Timeline` does not find the command.

## Regression

This appears to be a regression of #157015, fixed by #193544 and later reintroduced by #204180.

The earlier fix preserved the original view name explicitly:

```ts
title: {
original: `Focus on ${viewDescriptor.name.original} View`,
value: title
}
```

In #204180, this was replaced with `localize2(...)` using the localized value:

```ts
const title = localize2(
{ key: 'focus view', comment: ['{0} indicates the name of the view to be focused.'] },
"Focus on {0} View",
viewDescriptor.name.value
);
```

Because `localize2()` uses the same argument when producing both `value` and `original`, the generated English title also receives the localized view name.

## Related

- #157015
- #193544
- #204180

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.