You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to best apply localization to options and their descriptions?
With the annotation based approached, defining the description argument in an @Option requires to use a constant. So, defining the help text and description puts the string literal into the code base, rather than allowing to pull them from a ResourceBundle that allows for easy localization.
Is there any way to change that? For example, as an idea, introduce a descriptionProvider argument, expecting a class reference that will instantiate that referenced class and pass the name of the option along, so that can be used as a key in a ResourceBundle?
thanks,
Tobias W.
And I just noticed this is a duplicate of #415 and #22
The text was updated successfully, but these errors were encountered:
Yes, I'm aware of this one, and it has been climbing in priority on the todo list. Hopefully for the 3.6 release.
If you really need this now, you need to use the programmatic API.
@remkop Thanks for the response. I will stick with the annotations for now and keep an eye on this for future releases. Thanks for this well designed library, I really appreciate the thought that went into it. Itś hard to find something this easy for some other languages.
How to best apply localization to options and their descriptions?
With the annotation based approached, defining the description argument in an
@Option
requires to use a constant. So, defining the help text and description puts the string literal into the code base, rather than allowing to pull them from aResourceBundle
that allows for easy localization.Is there any way to change that? For example, as an idea, introduce a descriptionProvider argument, expecting a class reference that will instantiate that referenced class and pass the name of the option along, so that can be used as a key in a ResourceBundle?
thanks,
Tobias W.
And I just noticed this is a duplicate of #415 and #22
The text was updated successfully, but these errors were encountered: