Skip to content

Commit

Permalink
address code review feedback: remove unused LocalizationResources met…
Browse files Browse the repository at this point in the history
…hods and resources
  • Loading branch information
adamsitnik committed Feb 17, 2023
1 parent 69fb412 commit b8a9761
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 405 deletions.
19 changes: 0 additions & 19 deletions src/System.CommandLine/LocalizationResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ internal static class LocalizationResources
internal static string ExpectsOneArgument(OptionResult optionResult)
=> GetResourceString(Properties.Resources.OptionExpectsOneArgument, GetOptionName(optionResult), optionResult.Tokens.Count);

/// <summary>
/// Interpolates values into a localized string similar to No argument was provided for Command &apos;{0}&apos;..
/// </summary>
internal static string NoArgumentProvided(SymbolResult symbolResult) =>
symbolResult is CommandResult commandResult
? GetResourceString(Properties.Resources.CommandNoArgumentProvided, commandResult.Token.Value)
: GetResourceString(Properties.Resources.OptionNoArgumentProvided, GetOptionName((OptionResult)symbolResult));

/// <summary>
/// Interpolates values into a localized string similar to Command &apos;{0}&apos; expects no more than {1} arguments, but {2} were provided.
/// </summary>
internal static string ExpectsFewerArguments(
Token token,
int providedNumberOfValues,
int maximumNumberOfValues) =>
token.Type == TokenType.Command
? GetResourceString(Properties.Resources.CommandExpectsFewerArguments, token, maximumNumberOfValues, providedNumberOfValues)
: GetResourceString(Properties.Resources.OptionExpectsFewerArguments, token, maximumNumberOfValues, providedNumberOfValues);

/// <summary>
/// Interpolates values into a localized string similar to Directory does not exist: {0}.
/// </summary>
Expand Down
45 changes: 0 additions & 45 deletions src/System.CommandLine/Properties/Resources.Designer.cs

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

15 changes: 0 additions & 15 deletions src/System.CommandLine/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CommandExpectsFewerArguments" xml:space="preserve">
<value>Command '{0}' expects no more than {1} arguments, but {2} were provided.</value>
</data>
<data name="CommandExpectsOneArgument" xml:space="preserve">
<value>Command '{0}' expects a single argument but {1} were provided.</value>
</data>
<data name="CommandNoArgumentProvided" xml:space="preserve">
<value>No argument was provided for Command '{0}'.</value>
</data>
<data name="DirectoryDoesNotExist" xml:space="preserve">
<value>Directory does not exist: '{0}'.</value>
</data>
<data name="OptionExpectsFewerArguments" xml:space="preserve">
<value>Option '{0}' expects no more than {1} arguments, but {2} were provided.</value>
</data>
<data name="OptionExpectsOneArgument" xml:space="preserve">
<value>Option '{0}' expects a single argument but {1} were provided.</value>
</data>
<data name="OptionNoArgumentProvided" xml:space="preserve">
<value>No argument was provided for Option '{0}'.</value>
</data>
<data name="FileDoesNotExist" xml:space="preserve">
<value>File does not exist: '{0}'.</value>
</data>
Expand Down
25 changes: 0 additions & 25 deletions src/System.CommandLine/Properties/xlf/Resources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
<target state="new">Cannot parse argument '{0}' for option '{1}' as expected type '{2}'. Did you mean one of the following?{3}</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsFewerArguments">
<source>Command '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">Příkaz '{0}' očekává maximálně tento počet argumentů: {1}. Zadal se jich ale tento počet: {2}.</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsOneArgument">
<source>Command '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Command '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="CommandNoArgumentProvided">
<source>No argument was provided for Command '{0}'.</source>
<target state="new">No argument was provided for Command '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="CommandRequiredArgumentMissing">
<source>Required argument missing for command: '{0}'.</source>
<target state="translated">Chybí povinný argument pro příkaz: '{0}'.</target>
Expand Down Expand Up @@ -147,21 +132,11 @@
<target state="translated">Znak se v cestě nepovoluje: '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsFewerArguments">
<source>Option '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">Možnost '{0}' očekává maximálně tento počet argumentů: {1}. Zadal se jich ale tento počet: {2}.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsOneArgument">
<source>Option '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Option '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="OptionNoArgumentProvided">
<source>No argument was provided for Option '{0}'.</source>
<target state="new">No argument was provided for Option '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionRequiredArgumentMissing">
<source>Required argument missing for option: '{0}'.</source>
<target state="translated">Chybí povinný argument pro možnost: '{0}'.</target>
Expand Down
25 changes: 0 additions & 25 deletions src/System.CommandLine/Properties/xlf/Resources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
<target state="new">Cannot parse argument '{0}' for option '{1}' as expected type '{2}'. Did you mean one of the following?{3}</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsFewerArguments">
<source>Command '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">Der Befehl '{0}' erwartet maximal {1} Argumente, es wurden jedoch {2} angegeben.</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsOneArgument">
<source>Command '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Command '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="CommandNoArgumentProvided">
<source>No argument was provided for Command '{0}'.</source>
<target state="new">No argument was provided for Command '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="CommandRequiredArgumentMissing">
<source>Required argument missing for command: '{0}'.</source>
<target state="translated">Ein erforderliches Argument fehlt für den Befehl: '{0}'.</target>
Expand Down Expand Up @@ -147,21 +132,11 @@
<target state="translated">Zeichen in Pfad nicht zulässig: '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsFewerArguments">
<source>Option '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">Die Option '{0}' erwartet maximal {1} Argumente, es wurden jedoch {2} angegeben.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsOneArgument">
<source>Option '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Option '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="OptionNoArgumentProvided">
<source>No argument was provided for Option '{0}'.</source>
<target state="new">No argument was provided for Option '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionRequiredArgumentMissing">
<source>Required argument missing for option: '{0}'.</source>
<target state="translated">Ein erforderliches Argument fehlt für die Option: '{0}'.</target>
Expand Down
27 changes: 1 addition & 26 deletions src/System.CommandLine/Properties/xlf/Resources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
<target state="new">Cannot parse argument '{0}' for option '{1}' as expected type '{2}'. Did you mean one of the following?{3}</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsFewerArguments">
<source>Command '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">El comando '{0}' no espera más de {1} argumentos, pero se proporcionaron {2}.</target>
<note></note>
</trans-unit>
<trans-unit id="CommandExpectsOneArgument">
<source>Command '{0}' expects a single argument but {1} were provided.</source>
<target state="translated">El comando '{0}' espera un solo argumento, pero se proporcionaron {1}.</target>
<note></note>
</trans-unit>
<trans-unit id="CommandNoArgumentProvided">
<source>No argument was provided for Command '{0}'.</source>
<target state="translated">No se proporcionó ningún argumento para el comando '{0}'.</target>
<note></note>
</trans-unit>
<trans-unit id="CommandRequiredArgumentMissing">
<source>Required argument missing for command: '{0}'.</source>
<target state="translated">Falta el argumento requerido para el comando: '{0}'.</target>
Expand Down Expand Up @@ -147,21 +132,11 @@
<target state="translated">Carácter no permitido en una ruta: '{0}'.</target>
<note></note>
</trans-unit>
<trans-unit id="OptionExpectsFewerArguments">
<source>Option '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">La opción '{0}' no espera más de {1} argumentos, pero se proporcionaron {2}.</target>
<note></note>
</trans-unit>
<trans-unit id="OptionExpectsOneArgument">
<source>Option '{0}' expects a single argument but {1} were provided.</source>
<target state="translated">La opción '{0}' espera un solo argumento, pero se proporcionaron {1}.</target>
<note></note>
</trans-unit>
<trans-unit id="OptionNoArgumentProvided">
<source>No argument was provided for Option '{0}'.</source>
<target state="translated">No se proporcionó ningún argumento para la opción '{0}'.</target>
<note></note>
</trans-unit>
<trans-unit id="OptionRequiredArgumentMissing">
<source>Required argument missing for option: '{0}'.</source>
<target state="translated">Falta el argumento requerido para la opción: '{0}'.</target>
Expand Down Expand Up @@ -209,4 +184,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
25 changes: 0 additions & 25 deletions src/System.CommandLine/Properties/xlf/Resources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
<target state="new">Cannot parse argument '{0}' for option '{1}' as expected type '{2}'. Did you mean one of the following?{3}</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsFewerArguments">
<source>Command '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">La commande '{0}' n'attend pas plus de {1} arguments, mais {2} ont été fournis.</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsOneArgument">
<source>Command '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Command '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="CommandNoArgumentProvided">
<source>No argument was provided for Command '{0}'.</source>
<target state="new">No argument was provided for Command '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="CommandRequiredArgumentMissing">
<source>Required argument missing for command: '{0}'.</source>
<target state="translated">Argument obligatoire manquant pour la commande : '{0}'.</target>
Expand Down Expand Up @@ -147,21 +132,11 @@
<target state="translated">Caractère non autorisé dans un chemin : '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsFewerArguments">
<source>Option '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">L'option '{0}' n'attend pas plus de {1} arguments, mais {2} ont été fournis.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsOneArgument">
<source>Option '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Option '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="OptionNoArgumentProvided">
<source>No argument was provided for Option '{0}'.</source>
<target state="new">No argument was provided for Option '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionRequiredArgumentMissing">
<source>Required argument missing for option: '{0}'.</source>
<target state="translated">Argument obligatoire manquant pour l'option : '{0}'.</target>
Expand Down
25 changes: 0 additions & 25 deletions src/System.CommandLine/Properties/xlf/Resources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
<target state="new">Cannot parse argument '{0}' for option '{1}' as expected type '{2}'. Did you mean one of the following?{3}</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsFewerArguments">
<source>Command '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">Il comando '{0}' prevede non più di {1} argomenti, ma ne sono stati forniti {2}.</target>
<note />
</trans-unit>
<trans-unit id="CommandExpectsOneArgument">
<source>Command '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Command '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="CommandNoArgumentProvided">
<source>No argument was provided for Command '{0}'.</source>
<target state="new">No argument was provided for Command '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="CommandRequiredArgumentMissing">
<source>Required argument missing for command: '{0}'.</source>
<target state="translated">Manca l'argomento obbligatorio per il comando: '{0}'.</target>
Expand Down Expand Up @@ -147,21 +132,11 @@
<target state="translated">Il carattere non è consentito in un percorso: '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsFewerArguments">
<source>Option '{0}' expects no more than {1} arguments, but {2} were provided.</source>
<target state="translated">L'opzione '{0}' prevede non più di {1} argomenti, ma ne sono stati forniti {2}.</target>
<note />
</trans-unit>
<trans-unit id="OptionExpectsOneArgument">
<source>Option '{0}' expects a single argument but {1} were provided.</source>
<target state="new">Option '{0}' expects a single argument but {1} were provided.</target>
<note />
</trans-unit>
<trans-unit id="OptionNoArgumentProvided">
<source>No argument was provided for Option '{0}'.</source>
<target state="new">No argument was provided for Option '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="OptionRequiredArgumentMissing">
<source>Required argument missing for option: '{0}'.</source>
<target state="translated">Manca l'argomento obbligatorio per l'opzione: '{0}'.</target>
Expand Down
Loading

0 comments on commit b8a9761

Please sign in to comment.