Skip to content
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

i18n #22

Closed
remkop opened this issue Feb 7, 2017 · 2 comments
Closed

i18n #22

remkop opened this issue Feb 7, 2017 · 2 comments

Comments

@remkop
Copy link
Owner

remkop commented Feb 7, 2017

Ideas:

  • @option(..., i18nKey="myKey") -look up myKey in ResourceBundle
  • @option(..., description="A b c d") -look up A_b_c_d in ResourceBundle
  • look up fully qualified field name in ResourceBundle
@remkop remkop modified the milestone: 0.4.0 advanced option parsing Feb 7, 2017
@remkop remkop modified the milestones: 0.5.0 advanced option parsing, 0.6.0 polishing Mar 31, 2017
@remkop remkop modified the milestones: backlog, 1.?.0 polishing Apr 25, 2017
@remkop remkop modified the milestones: backlog, 3.2 May 16, 2018
@remkop remkop modified the milestones: 3.4, 3.6 Aug 3, 2018
@polarapfel polarapfel mentioned this issue Aug 7, 2018
@remkop
Copy link
Owner Author

remkop commented Aug 23, 2018

The name of the resource bundle could be fixed or specified in @Command(resourceBundle = "name").
Resource bundle keys could be based on the option name (either long or short), for positional parameters, the key could be the index. Alternatively, we could define a new annotation attribute for the resource bundle key:

@Option(names = "--option1")                             String option1;
@Option(names = "--option2", descriptionKey = "option2") String option2;
@Parameters(index = "0")                                 String param1;
@Parameters(index = "0", descriptionKey = "param2")      String param2;

This may be interesting for reference: https://github.com/tomitribe/crest#help-text

remkop added a commit that referenced this issue Aug 30, 2018
remkop added a commit that referenced this issue Aug 31, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 2, 2018
remkop added a commit that referenced this issue Sep 4, 2018
@remkop
Copy link
Owner Author

remkop commented Sep 5, 2018

Note on conflicts:

  • Resource bundle set in a superclass are used if subclass doesn’t set its own resource bundle
  • If subclass does set its own bundle that one is used (an empty bundle essentially disables the superclass bundle)
  • Bundle set by mixins are used unless the “host” command sets its own resource bundle (then the mixin bundle is ignored, even for the options and positional parameters contributed by the mixin)
  • Bundle set by parent command are used for all subcommands, unless the subcommand sets its own resource bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant