yargs / yargs/yargs

Support for locale based help (descriptions)?

Open
#2,094 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
JavaScript
Stars
11.5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Currently, defualt help message is locale based. So it looks quite wierd to see only help command descriptions are translated.

Maybe we can add locale based description like below using dictionary:

.option('output', {
            alias: 'o',
            describe: {'en': 'Specify output filename', 'ja': '出力ファイル名の指定'},
            default: 'newfile',
        })

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by locating the .option() API and the help-rendering code, then trace how the current locale is selected for the default help message. Define how a localized describe dictionary should choose its language and how missing translations behave. Done means option descriptions appear in the selected locale without breaking existing string descriptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.