Open
Description
The incoming mechanisms for setting the culture via environment variables and directives (#951) don't allow a straightforward way to localize descriptions, because the parser is configured before the middleware that sets the culture gets executed.
Example:
static void Main(string[] args)
{
// OOPS: Environment variable isn't set yet, and neither is the current culture the one we'll be using at invocation time
var description = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_GLOBALIZATION_CULTURE") switch
{
"es-ES" => "hola",
_ => "hello"
};
var option1 = new Option<string>("-x", description);
new RootCommand
{
option1
}.Invoke(args);
}