-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgGroup: localization of heading text #654
Comments
That's great feedback, thank you! About your first question, the resource bundle keys can be prefixed with the command name but not with arg group names. For the purpose of localization, the arg groups are ignored; keys are just the option names with optionally the command name as prefix. Since options need to be unique in the command, this should not be a problem. Definitely need to improve the docs though!
The above is the expected behaviour. I like all your suggestions to improve the docs, in addition we can also add an example to Do you feel like providing a pull request for this? |
Thanks for your quick reply. I'm still struggling with the localization of the heading of an argument group. Using a literal string as heading text (using the code fragment given below) works great for me:
It's still unclear to me, however how to put the heading string in a resource bundle. I tried this, to no avail:
Bundle.properties:
Hopefully you can clarify what's the correct way to get the heading text of an argument group localized.
Great to hear that.
Yes, I will try to prepare a PR. I can't promise it though. |
My bad. Looking closer I just realized that localization of heading text has not been implemented yet... |
I pushed a fix with unit test for the broken arg group heading localization to master. It should work now. Please verify. Note that the heading text should end with |
I can confirm that it works now as expected. Thanks for your great work! |
Added more detailed examples to the Internationalization section in the user manual, as discussed above. |
Some more feedback on picocli 4.0.0-alpha-1, as invited / requested in the release::
I defined a mutually exclusive argument group and specified a heading for the group and description for the option(s). This worked fine.
In the next step, I wanted to put these string resources (heading, description) into a resource bundle.
First, I had a look at chapter 16. Internationalization of the manual, but I couldn't find anything related there (maybe you can extend the documentation here!?). Later on, I found the following description in the manual:
I played around quite a while, but I couldn't get it working.
My code looks like:
Bundle.properties
Can you advice what me what keys need to be used here?
In the release notes, you asked:
IMHO, chapter 16. Internationalization is a bit sparse. Having dealt with i18n issues some time ago, I read the chapter again today and things came back to my mind. For me i18n was quite a challenging task, I'm on the impression that documentation could and should be a bit more elaborate here.
Example:
16.2. Example Resource Bundle, after the first code block:
It might be unclear what
descriptionKey
means here. It would already help to write:It would be even better to have a full working example here. Maybe we can add an example to the codebase and link to it from the manual, preventing the manual from getting bloated.
Another example:
Again, description is quite terse, I would prefer to have a more verbose version here, something like
Just my ideas, thanks for your continued great work on picocli!
The text was updated successfully, but these errors were encountered: