-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Headers are hard-coded in Help.formatHelp() #1608
Comments
import process from 'process';
import { Command } from 'commander';
const program = new Command();
program.configureOutput({
writeErr: (str) => process.stderr.write(
str
.replace('error:', 'ошибка:')
// Proceed to replace other tokens from lib/command.js.
),
writeOut: (str) => process.stdout.write(
str
.replace('Arguments:', 'Аргументы:')
.replace('Commands:', 'Команды:')
.replace('Options:', 'Опции:')
.replace('Usage:', 'Использование:')
),
});
program.parse(process.argv); |
I did mean import * as process from 'process';
import { Command, Help } from 'commander';
const program = new Command();
program.configureHelp({
formatHelp: (cmd, helper) => {
const originalHelp = new Help();
return originalHelp.formatHelp(cmd, helper)
.replace('Arguments:', 'Аргументы:')
.replace('Commands:', 'Команды:')
.replace('Options:', 'Опции:')
.replace('Usage:', 'Использование:');
}
});
program.parse(process.argv); |
Ah, now I see how to use |
Anyone following this issue is likely to be interested in #1801 |
Is there a cleaner way to internationalize the headers, which are hard-coded in
Help.formatHelp()
, i. e. Arguments, Commands, Options, Usage?The text was updated successfully, but these errors were encountered: