Tyrrrz/CliFx

Add multi-language output message support

AlisaAkiron opened this issue · 5 comments

Details

This framework is awesome. But unfortunately, it can only output messages in English. I want it can print messages in other languages to offer better user experience. So I wonder if the framework can add multi-language support or just make the output messages customizable. Thanks.

To clarify, you mean the error messages and the help text?

Yes. The help text and error messages.
For example, "you can run blablabla to show help in a specific command", I want to print it in other language.
And others like "USAGE", "DESCRIPTION", "OPTIONS", etc.

I think the best option here is to allow users to change those strings, although I'm not sure what's a good way to do that.

I think instead of allowing users to change those strings, it may be better to use .resx localization to achieve multi-language output. That way help messages would be in different languages depending on the user pc language.

In addition, something like this should be added to complement multi-language output support.

[Command(Description = "HelloWorldDescription", ResourceType = typeof(Resources))] // Search for static string property "HelloWorldDescription" in type "Resources" using reflection and get the value
public class HelloWorldCommand : ICommand

Marking this as out-of-scope because:

  1. the burden of maintaining different translations for every user-facing string in the library will be too high
  2. most CLI tools don't provide support for multiple languages