Skip to content

Fix Chinese translation of dotnet workload search command #50265

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 14, 2025

The Chinese localization was incorrectly translating the dotnet workload search command to Chinese characters (dotnet 工作负载搜索) instead of preserving the literal English command. This caused confusion for Chinese users who would see an invalid command suggestion.

Problem:
When running dotnet workload repair in a Chinese environment with no workloads installed, users would see:

未安装工作负载,没有要修复的内容。请运行"dotnet 工作负载搜索",查找要安装的工作负载。

The command dotnet 工作负载搜索 is not valid - CLI commands should remain in English even in localized environments.

Solution:

  • Added {Locked="dotnet workload search"} comment to the NoWorkloadsToRepair string in CliCommandStrings.resx to prevent the command from being translated
  • Built the project to automatically update all .xlf localization files with the proper locking directive
  • Corrected the Chinese translation to preserve the English command

After fix:
Chinese users now see the correct output:

未安装工作负载,没有要修复的内容。请运行"dotnet workload search",查找要安装的工作负载。

The command is now properly shown as "dotnet workload search" in English, consistent with other similar command suggestions throughout the CLI.

Testing:

  • Verified the fix works in Chinese (zh-Hans) environment
  • Confirmed English and German localizations continue to work correctly
  • All builds pass successfully

This follows the established pattern used by other CLI command strings in the codebase that use the {Locked=} directive to prevent translation of command names.

Fixes #50235.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Incorrect Chinese command suggestion in dotnet workload repair Fix Chinese translation of dotnet workload search command Aug 14, 2025
@Copilot Copilot AI requested a review from marcpopMSFT August 14, 2025 21:05
Copilot finished work on behalf of marcpopMSFT August 14, 2025 21:05
@marcpopMSFT marcpopMSFT marked this pull request as ready for review August 14, 2025 22:31
@Copilot Copilot AI review requested due to automatic review settings August 14, 2025 22:31
@marcpopMSFT marcpopMSFT requested a review from joeloff August 14, 2025 22:31
Copy link
Contributor

@Copilot 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

This PR fixes a localization issue where the dotnet workload search command was being incorrectly translated to Chinese characters in localized environments, making it an invalid command that users couldn't execute.

  • Added a {Locked="dotnet workload search"} comment to the source .resx file to prevent translation of the CLI command
  • Updated all .xlf localization files to mark translations as needing review and include the locking directive
  • Corrected Chinese translations to preserve the English command while keeping the rest of the message localized

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CliCommandStrings.resx Added locking comment to prevent translation of "dotnet workload search" command
CliCommandStrings.zh-Hans.xlf Fixed Chinese (Simplified) translation to preserve English command
CliCommandStrings.zh-Hant.xlf Fixed Chinese (Traditional) translation to preserve English command
CliCommandStrings.cs.xlf Updated Czech translation state and added locking note
CliCommandStrings.de.xlf Updated German translation state and added locking note
CliCommandStrings.es.xlf Updated Spanish translation state and added locking note
CliCommandStrings.fr.xlf Updated French translation state and added locking note
CliCommandStrings.it.xlf Updated Italian translation state and added locking note
CliCommandStrings.ja.xlf Updated Japanese translation state and added locking note
CliCommandStrings.ko.xlf Updated Korean translation state and added locking note
CliCommandStrings.pl.xlf Updated Polish translation state and added locking note
CliCommandStrings.pt-BR.xlf Updated Portuguese (Brazil) translation state and added locking note
CliCommandStrings.ru.xlf Updated Russian translation state and added locking note
CliCommandStrings.tr.xlf Updated Turkish translation state and added locking note

@marcpopMSFT marcpopMSFT enabled auto-merge August 14, 2025 22:31
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 this pull request may close these issues.

Incorrect Chinese command suggestion in dotnet workload repair
2 participants