Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/Cli/dotnet/Commands/CliCommandStrings.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -550,7 +550,7 @@ This is equivalent to deleting project.assets.json.</value>
<value>Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option.</value>
</data>
<data name="CmdProjectDescription" xml:space="preserve">
<value>Defines the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory.</value>
<value>Defines the path of the project file to run. Use path to the project file, or path to the directory containing the project file. If not specified, it defaults to the current directory.</value>
</data>
Copy link
Member

Choose a reason for hiding this comment

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

@copilot This resource is unused now? It can be deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in commit cecdc27. Deleted both CmdProjectDescription and CommandOptionProjectDescription resources as they are no longer used after switching to the parameterized CmdProjectDescriptionFormat.

<data name="CmdProjectPathName" xml:space="preserve">
<value>PROJECT_PATH</value>
Expand Down Expand Up @@ -593,12 +593,15 @@ If not specified the file will be generated inside the default 'TestResults' dir
<data name="CmdSettingsFile" xml:space="preserve">
<value>SETTINGS_FILE</value>
</data>
<data name="CmdSolutionDescription" xml:space="preserve">
<value>Defines the path of the solution file to run. If not specified, it defaults to the current directory.</value>
</data>
<data name="CmdSolutionPathName" xml:space="preserve">
<value>SOLUTION_PATH</value>
</data>
<data name="TestCmdProjectDescription" xml:space="preserve">
<value>Defines the path of the project file to test. Use path to the project file, or path to the directory containing the project file. If not specified, it defaults to the current directory.</value>
</data>
<data name="TestCmdSolutionDescription" xml:space="preserve">
<value>Defines the path of the solution file to test. Use path to the project file, or path to the directory containing the project file. If not specified, it defaults to the current directory.</value>
</data>
<data name="CmdSourceOption" xml:space="preserve">
<value>SOURCE</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ internal static class MicrosoftTestingPlatformOptions
{
public static readonly Option<string> ProjectOption = new("--project")
{
Description = CliCommandStrings.CmdProjectDescription,
Description = CliCommandStrings.TestCmdProjectDescription,
Copy link
Member

Choose a reason for hiding this comment

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

I have a minor nit: the strings for run and test are the same except for the 'verb' used - we've been extracting this pattern out to shared strings and providing the 'verb' as a parameter when creating the Option/Argument.

@copilot can you extract the shared loc string and update the test and run usages of the Project and Solution options to use the shared string, passing in the matching verb?

Copy link
Member

Choose a reason for hiding this comment

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

@baronfel Is it fine if the words "run"/"test" are not localized? Or do we want to also have resources with "single" words for "run" and "test" so they are localized?

Copy link
Member

Choose a reason for hiding this comment

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

good point - @copilot make those single words localizeable as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit 99e653e. Created parameterized resource strings CmdProjectDescriptionFormat and CmdSolutionDescriptionFormat, and factory methods CommonOptions.ProjectOption(string verb) and CommonOptions.SolutionOption(string verb). Both test and run commands now use these shared methods with their respective verbs ("test" and "run").

Test command:

--project <PROJECT_PATH>    Defines the path of the project file to test. Use path to the project file, or 
                            path to the directory containing the project file. If not specified, it 
                            defaults to the current directory.

Run command:

--project <PROJECT_PATH>    Defines the path of the project file to run. Use path to the project file, or 
                            path to the directory containing the project file. If not specified, it 
                            defaults to the current directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit d8074b5. Added localized verb resources VerbRun and VerbTest in CliCommandStrings.resx. Updated both test and run command parsers to use these localized strings instead of hardcoded "test" and "run".

Changes:

  • Created VerbRun and VerbTest resource strings
  • Updated MicrosoftTestingPlatformOptions to use CliCommandStrings.VerbTest
  • Updated RunCommandParser to use CliCommandStrings.VerbRun

The verbs are now properly localizable, ensuring consistent translations across all languages.

HelpName = CliCommandStrings.CmdProjectPathName,
Arity = ArgumentArity.ExactlyOne
};

public static readonly Option<string> SolutionOption = new("--solution")
{
Description = CliCommandStrings.CmdSolutionDescription,
Description = CliCommandStrings.TestCmdSolutionDescription,
HelpName = CliCommandStrings.CmdSolutionPathName,
Arity = ArgumentArity.ExactlyOne
};
Expand Down
19 changes: 12 additions & 7 deletions src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading