commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Help Localization for the 'Default' word and its boolean values

Open manoletto opened this issue 3 years ago • 1 comments

Hello,

Great project !

Found and implemented localization with the LocalizableSentenceBuilder class as explained in : https://github.com/commandlineparser/commandline/wiki/Help-Localization


Optionally,

To localize the keywords "Required,Default" and the error messages, add the the string expressions of the class SentenceBuilder to the resource files.

You can add the class LocalizableSentenceBuilder to your project. It's localized and located here

In the Main method, Set sentence builder to LocalizableSentenceBuilder:

  SentenceBuilder.Factory = () => new LocalizableSentenceBuilder();

But nowhere i can find where to translate the 'Default' word !?

With an option as : [Option('l', Default = false, HelpText = "Enregistrer un journal.")]

Using the HelpText.AutoBuild(), it display : -l (Default: false) Enregistrer un journal.

Is it possible to also translate false or true by 'désactivé' or 'activé' ?

manoletto avatar Jun 02 '21 16:06 manoletto

+1

SentenceBuilder should provide methods for Default and Verb words. And be used here:

  • https://github.com/commandlineparser/commandline/blob/master/src/CommandLine/Text/HelpText.cs#L857
  • https://github.com/commandlineparser/commandline/blob/master/src/CommandLine/Text/HelpText.cs#L975

mmarinchenko avatar Dec 22 '21 02:12 mmarinchenko