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

The updateStrings() could not work on 'Options:' #1598

Closed
tianyingchun opened this issue Mar 24, 2020 · 5 comments · Fixed by #1600
Closed

The updateStrings() could not work on 'Options:' #1598

tianyingchun opened this issue Mar 24, 2020 · 5 comments · Fixed by #1600
Labels

Comments

@tianyingchun
Copy link

tianyingchun commented Mar 24, 2020

   .updateStrings({
        command: chalk.cyan('command'),
        'Examples:': cyanUnderline('Examples:'),
        'Commands:': cyanUnderline('Commands:'),
        'Options:': cyanUnderline('Options:'),
        'Invalid values:': `${chalk.bgBlack.red('ERR! ')}${chalk.bold('Invalid values:')}`,
      })

the Options: location update can't work correctly. cause of

  // below line is always execute before  updateStrings();
  const defaultGroup = __('Options:')
  self.help = function help () {

while we show help like cmd -h the defaultGroup has been initialized earlier that updateLocale().

it's bug? BTW yargs v15.1.0 works fine.

@bcoe bcoe added bug p1 p2 and removed p1 labels Mar 24, 2020
@bcoe
Copy link
Member

bcoe commented Mar 24, 2020

@mleguen I think there were some tweaks to translations recently that might have effected this?

@mleguen
Copy link
Member

mleguen commented Mar 24, 2020

@bcoe It does is something I changed recently.

I should be able to have a closer look at this tomorrow.

mleguen pushed a commit that referenced this issue Mar 25, 2020
mleguen pushed a commit that referenced this issue Mar 25, 2020
To allow modifying its translation with updateLocale/updateStrings.

Fixes #1598
@mleguen
Copy link
Member

mleguen commented Mar 25, 2020

@bcoe It definitely was something I changed recently...

Fix ready to review in #1600.

mleguen pushed a commit that referenced this issue Mar 25, 2020
mleguen pushed a commit that referenced this issue Mar 25, 2020
To allow modifying its translation with updateLocale/updateStrings.

Fixes #1598
@bcoe
Copy link
Member

bcoe commented Mar 26, 2020

@mleguen I landed the yargs-parser fix and released it.

@mleguen
Copy link
Member

mleguen commented Mar 27, 2020

Thanks @bcoe

mleguen pushed a commit that referenced this issue Mar 27, 2020
mleguen pushed a commit that referenced this issue Mar 27, 2020
To allow modifying its translation with updateLocale/updateStrings.

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

Successfully merging a pull request may close this issue.

3 participants