yargs Node.js localization is about making generated CLI help, command explanations, validation messages and terminal guidance understandable across languages without breaking executable syntax. If you are looking for yargs locale(), updateStrings(), translated Node.js CLI help or localization of command errors, separate the library’s built-in translations from the messages and data formats that your application owns.
yargs can assemble commands and options, create usage pages and resolve a language for built-in messages through locale support. Its documented methods include locale(), detectLocale() and updateStrings(). That is valuable, but it does not mean every custom command description, imported message or application error has been translated automatically. The release must be checked in real terminal and packaged conditions.
Imagine parcel-audit, an illustrative CLI used by international delivery teams checking a manifest. A user executes parcel-audit check manifest.json –lang pt to get Portuguese explanations. The program must still refer to the same parcel IDs, use the same manifest schema and report the same actual result. This guide follows the whole path from locale choice and yargs help to validation failures, Unicode layout, completion and QA.
Quick answer: what to translate and what must stay stable
Use yargs locale() and documented localization features for framework-generated strings, and a separate application catalog for your own descriptions and diagnostics. Maintain stable command and option tokens, manifest keys, exit statuses and machine output. Test locale override, fallback and packaged distribution behavior instead of assuming that every string is translated.
- Translate explanations for people, not tokens interpreted by scripts.
- Choose and document language precedence, fallback and catalog coverage.
- Keep parsed values, exit outcomes, file effects and machine schemas unchanged.
- Test real help, invalid input, unicode paths, redirected output and packaged releases.
- Give the reader a valid command and a verifiable next action.
Contents
- Quick decision and the boundary between UI language and parsing
- How the framework organizes help and translation
- An inspectable code skeleton
- A full set of implementation decisions and troubleshooting cases
- Four-week implementation and release plan
- Frequently asked questions
- Official technical references and further reading
A practical starting point
The worked example is parcel-audit, a fictional program used to verify a multilingual delivery manifest and report unresolved entries. Its information includes package IDs, manifest paths, destinations and delivery states. No example in this guide is evidence that a real file, device, customer or external system was accessed. The program name and test data are illustrative, but the distinction between user-visible wording and executable behavior is real. If a translated sentence says “verified” while the program only read a filename, the sentence is wrong. A trustworthy interface reports the observed state instead of manufacturing a reassuring result.
Begin with a source-language transcript of parcel-audit check manifest.json --lang pt, a valid operation, missing input, invalid option and a domain failure. Capture stdout, stderr and process exit status. Then write down which strings are generated by yargs, which belong to the application and which are values supplied by the user. That map prevents someone from translating a package identifier or source field while leaving an important error untranslated. The reader’s main question is always practical: what can I do now, and what will happen if I do it?
Understand the two sources of language
yargs contains framework-generated terms for help, options and validation. Your application supplies usage prose, option descriptions, command summaries, examples and domain error text. The methods locale() and updateStrings() operate in the yargs localization domain; they should not be mistaken for a complete application translation platform.
Build a message inventory for both groups. A help page can contain a translated ‘Options’ heading alongside an untranslated ‘Check the manifest’ description because two owners generated the strings. A high-quality multilingual CLI covers the whole user task, not just the header labels.
Separate locale from command grammar
The library can detect operating-system locale or accept an explicit locale, while command tokens and option names remain a stable API. A command written in Portuguese may explain –format json, but users must still type the exact option and output type that the parser accepts. Translating ‘json’ into an ordinary word is not equivalent to adding a new supported enum value.
Many users invoke the same CLI from scripts and terminals. Script compatibility matters more than decorative wording. Keep aliases, configuration file keys and environment variable names intentional; add localized aliases only through versioned, tested behavior. Unannounced changes can break CI pipelines.
Design precedence and fallbacks
Prefer a documented, predictable language order, such as explicit –lang, then a supported preference, then operating-system locale and finally a stable source-language fallback. To ensure a yargs instance sees a locale at the appropriate stage, initialize the language layer before generating help and validation. If your –lang parameter is parsed by the same instance, consider a safe pre-resolution phase.
When overriding built-in text, the yargs API documentation instructs that an explicit locale should be set before updateStrings. Verify override keys and placeholder shapes against the version actually installed. A missing translation should not result in a fabricated successful operation or a broken formatter.
Keep validation meaningful
A strict unknown-option error, a failed check on input data and a rejected write permission are separate conditions. yargs offers strict modes and validation hooks; the application still owns domain rules. Translate failure messages so the reader knows what was rejected, why and what correction is supported. Avoid advice that changes an input value without authority.
Capture stdout, stderr and exit status during testing. Yargs help and failure behavior can interact with the program’s chosen exit configuration, asynchronous handlers and surrounding Node.js process. The only reliable evidence is the outcome of the packaged program in the actual execution modes.
Treat completion as executable navigation
Shell completion suggests tokens that a user may run. Localized descriptions can improve discoverability, but changed suggestions can accidentally create invalid commands. Keep canonical completion values and verify any locale-specific descriptions independently. Run suggestions in a controlled test project.
Terminal width, font coverage and directionality also matter. A help page that looks clean in English may become unreadable after a longer Spanish or German description. Narrow terminals and redirected output deserve their own cases, not an assumption based on a browser-rendered screenshot.
Release the complete Node.js artifact
The published npm package may exclude locale JSON files that happened to exist in the repository. It may run under different Node versions and environment variables. Test the packed tarball with npm pack and a clean installation, not only the development checkout.
Developers and translators should share a release checklist with real outcomes: help, usage error, domain error, no interactive input, redirected JSON, Unicode manifest paths and locale fallback. A stable command that happens to support more languages is more valuable than a visually translated command that silently changes what it does.
Illustrative code: start with observable behavior
This compact sketch shows the role of the parser; it is not a finished translation system. Connect message catalogs, locale resolution, security checks and meaningful tests before using the pattern in a release. Check the installed library documentation because APIs and generated messages can change between versions.
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
const argv = yargs(hideBin(process.argv))
.scriptName("parcel-audit")
.locale("en")
.option("lang", { type: "string", describe: "Language for messages" })
.command("check <file>", "Check a manifest", y =>
y.positional("file", { type: "string", describe: "Manifest path" }))
.strict()
.help()
.parse();
// Teaching skeleton: connect --lang and app catalogs before rendering messages.
Build a message inventory after the skeleton works. Give each user-facing sentence a stable purpose, a source owner, a supported locale, examples of its parameter values, and a description of what it must not imply. Include messages that occur only after an error, including empty input and declined confirmation. These messages are often where a person most needs clarity. Do not claim that a locale is fully supported if only the happy-path help has been translated.
Implementation decisions and troubleshooting investigations
These investigations move from the parser contract to language resources, user input, terminal rendering and packaged software. Each starts with a symptom someone can see, identifies the responsible boundary, suggests a narrowly scoped correction and states a test that can disprove the fix. Not every application needs every feature. Use the cases as a field checklist and adapt them to the command your readers actually run.
Understanding help and executable syntax
1. Built-in headings
Consider a developer maintaining a Node.js data-delivery command-line utility: The word Options is translated but command descriptions are English. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: yargs owns framework labels while the app owns supplied descriptions. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Catalog and translate each application-provided usage and option description. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare every visible –help line in two locales. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
2. locale override
Consider a developer maintaining a Node.js data-delivery command-line utility: A requested –lang pt still prints English. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The yargs locale was selected before the application resolved the flag. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Resolve language early and set locale explicitly before help rendering. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run with –lang and a conflicting operating-system locale. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
3. detectLocale behavior
Consider a developer maintaining a Node.js data-delivery command-line utility: Tests pass locally but CI uses a different language. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Automatic OS locale detection was relied upon implicitly. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Choose and document when detectLocale should apply. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Set two OS locale environments and verify the expected result. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
4. updateStrings order
Consider a developer maintaining a Node.js data-delivery command-line utility: The custom Options heading disappears after changing locale. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The override was installed before an explicit locale change. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Set locale before updateStrings as documented and verify override keys. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Render help immediately after both operations. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
5. updateStrings keys
Consider a developer maintaining a Node.js data-delivery command-line utility: A custom translation is not applied to one heading. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The override key does not match the library’s source message. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Use exact supported keys and test the installed package version. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare the generated source string and replacement. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
6. Application catalog
Consider a developer maintaining a Node.js data-delivery command-line utility: An error from the check handler remains untranslated. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Only yargs’ own built-in message catalog was configured. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Use app-owned stable message IDs for domain diagnostics. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Trigger a known bad manifest and inspect the handler response. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
7. Usage string
Consider a developer maintaining a Node.js data-delivery command-line utility: The usage page offers a translated command token that fails. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: An example’s syntax was translated as natural language. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Keep executable tokens literal while translating the explanation. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Copy each displayed invocation and run it. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
8. Command description
Consider a developer maintaining a Node.js data-delivery command-line utility: A nested command has no translated summary. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: A builder registered a literal English command description. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Translate the command summary before registration. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run root help and child help for all commands. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
Locale resources and wording ownership
9. Option describe
Consider a developer maintaining a Node.js data-delivery command-line utility: A newly added –checksum option appears in English. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The option’s describe field escaped string extraction. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Inventory describe fields and enforce catalog coverage. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare help inventories after adding the option. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
10. Positional describe
Consider a developer maintaining a Node.js data-delivery command-line utility: Help describes a manifest as a destination rather than input. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The translator lacked context about input semantics. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Clarify that the file is read and not overwritten. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Use the command against a temporary fixture and inspect side effects. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
11. Demanded options
Consider a developer maintaining a Node.js data-delivery command-line utility: A required option reads as optional in another locale. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The description was written separately from demandOption behavior. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Align wording with the actual requirement and fallback. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run with and without the required option. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
12. Strict options
Consider a developer maintaining a Node.js data-delivery command-line utility: Unknown –lagn is silently accepted by a wrapper. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The wrapper omitted strictOptions or swallowed validation. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Enforce the intended unknown-option policy and preserve failure status. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Test misspelled flags and observe actual parsed argv. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
13. Strict commands
Consider a developer maintaining a Node.js data-delivery command-line utility: A misspelled subcommand gets a misleading suggestion. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The error path uses a different text owner and validation mode. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Audit strictCommands behavior and localize recovery without promising aliases. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Try unknown commands and check supported alternatives. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
14. Choice lists
Consider a developer maintaining a Node.js data-delivery command-line utility: A translated choice is not accepted by the parser. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The labels were changed without changing allowed values. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Explain choices locally but preserve canonical machine values. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Test every displayed choice and one invalid choice. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
15. Locale list
Consider a developer maintaining a Node.js data-delivery command-line utility: A requested regional locale shows mixed-language messages. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Fallback between region and base language was undocumented. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Define supported tags, fallback and missing-resource behavior. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Test pt-BR, pt and an unsupported region. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
16. Plural counts
Consider a developer maintaining a Node.js data-delivery command-line utility: The message for one parcel is repeated for hundreds. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: An English plural rule was embedded in template interpolation. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Adopt application catalog plural forms and typed count placeholders. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Check zero, one, two and large counts in target languages. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
Errors, terminals and user recovery
17. Placeholders
Consider a developer maintaining a Node.js data-delivery command-line utility: A translated message prints undefined in place of a filename. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: A placeholder name changed between messages and handler code. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Validate named arguments during catalog loading or tests. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run a missing-file case with a Unicode path. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
18. Examples
Consider a developer maintaining a Node.js data-delivery command-line utility: Help examples point to an obsolete command alias. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Old examples were kept after a command tree refactor. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Revalidate each complete example in every supported language. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Execute examples in a disposable workspace. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
19. Help option
Consider a developer maintaining a Node.js data-delivery command-line utility: –help is translated as a different, unrecognized flag. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The textual label and parser token were conflated. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Keep the help token stable unless a new alias is deliberately supported. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Invoke help through every documented entry point. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
20. Version output
Consider a developer maintaining a Node.js data-delivery command-line utility: An automatically formatted version line is incorrect. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The package metadata and help copy use different version sources. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Use one canonical version reference and localize only explanatory prose. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare –version with package metadata. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
21. Wrap width
Consider a developer maintaining a Node.js data-delivery command-line utility: A lengthy translation breaks alignment in an 80-column terminal. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The locale’s expansion was not considered in help layout. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Test .wrap behavior and make descriptions concise and accurate. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Capture output at 40, 60 and 80 columns. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
22. Unicode manifest
Consider a developer maintaining a Node.js data-delivery command-line utility: A manifest filename in Devanagari displays as question marks. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Console encoding or path normalization damaged input. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Preserve Unicode path bytes and choose appropriate terminal encoding. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Open temporary files with non-ASCII names under each locale. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
23. Right-to-left output
Consider a developer maintaining a Node.js data-delivery command-line utility: Arabic help makes –output appear inside a translated sentence. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Bidirectional presentation was mixed with literal tokens. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Separate commands and examples clearly from prose. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Have a reader reproduce the input and inspect parsed arguments. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
24. Completion tokens
Consider a developer maintaining a Node.js data-delivery command-line utility: Localized completion offers a token the CLI rejects. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: A description was substituted into the value list. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Preserve completion values and separately localize supported descriptions. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run each completion suggestion in a test directory. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
Release QA, compatibility and evidence
25. Environment variables
Consider a developer maintaining a Node.js data-delivery command-line utility: An environment-driven option unexpectedly overrides a flag. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The user did not know the env prefix and precedence. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Document how env values interact with command-line arguments. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Set conflicting env and CLI values and inspect the winner. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
26. Configuration keys
Consider a developer maintaining a Node.js data-delivery command-line utility: Localization rewrites JSON configuration property names. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Human descriptions and stable configuration schema were mixed. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Keep configuration keys stable and translate their documentation. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Load the same config under multiple language settings. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
27. Validation check
Consider a developer maintaining a Node.js data-delivery command-line utility: A failed manifest check reports success in French. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The validation handler returned a normal result after printing an error. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Keep failure outcomes and exit statuses independent of wording. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Test corrupted input and assert a nonzero status. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
28. Fail handler
Consider a developer maintaining a Node.js data-delivery command-line utility: A custom failure message hides the invalid option name. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The fail callback omitted relevant parser context. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Include the actual rejected token and a tested next action. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Try a bad switch and invalid positional value. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
29. Async handlers
Consider a developer maintaining a Node.js data-delivery command-line utility: An asynchronous rejection produces duplicated error text. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Failure propagation was changed while localizing handlers. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Test supported async parse and error ownership without double reporting. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Reject a controlled promise and count user-facing diagnostics. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
30. Exit process
Consider a developer maintaining a Node.js data-delivery command-line utility: A test harness treats bad input as success. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The program changed default process exit handling without propagating status. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Choose an explicit, testable exit strategy for the application. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Inspect process exit code with exitProcess configuration used in production. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
31. JSON stdout
Consider a developer maintaining a Node.js data-delivery command-line utility: A tool consumer cannot parse data after the language changes. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Localized progress sentences were mixed into JSON stdout. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Separate human diagnostics from machine-readable output. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Pipe stdout through a real JSON parser in every locale. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
32. Unicode cell width
Consider a developer maintaining a Node.js data-delivery command-line utility: CJK headings cause option columns to drift. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Terminal cell width differs from JavaScript string length. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Test real terminals and adjust presentation where necessary. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare CJK and Latin help pages at narrow widths. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
Additional operational edge cases
33. npm pack
Consider a developer maintaining a Node.js data-delivery command-line utility: The published package lacks a locale resource. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: The package file list excludes localization assets. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Audit packed files and include required runtime catalogs. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Install the tarball in a clean folder. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
34. Platform paths
Consider a developer maintaining a Node.js data-delivery command-line utility: A Windows example is presented with Unix-only syntax. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: One platform’s shell quoting was translated without adaptation. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Write platform-specific executable examples where syntax differs. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Run representative commands on Windows and Unix shells. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
35. Deprecation notice
Consider a developer maintaining a Node.js data-delivery command-line utility: An old flag is translated as still recommended. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Deprecation copy is stale or hidden from the catalog. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Use accurate replacement advice and keep the accepted flag stable until removal. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Test old and replacement flags in the target locale. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
36. Telemetry codes
Consider a developer maintaining a Node.js data-delivery command-line utility: An alert rule stops matching after a translation. This is more consequential than an awkward phrase because a reader may act on the visible instruction, while software still obeys the parser’s own rules. In a working command such as parcel-audit check manifest.json --lang pt, the difference can affect the outcome of verify a multilingual delivery manifest and report unresolved entries. Record the exact invocation and language setting before editing the sentence.
Trace the cause before translating again: Log event codes were replaced with translated sentences. Ask which layer owns the text, whether it is evaluated while the command is built or while the command runs, and whether the disputed wording describes an accepted token, a human explanation or a durable data value. This distinction is especially important for yargs, where the same terminal screen can contain library-generated help, application messages and unmodified user data.
A focused correction is to Keep stable machine event identifiers and add separate localized text. Review the result in context rather than approving an isolated phrase. State the allowed next action plainly, preserve actual constraints and avoid adding promises that the program cannot fulfill. If the incident involves a value from a file or input, leave that value intact unless a separately documented feature explicitly changes the data. A translation is successful only when the new wording is both understandable and true.
The acceptance test is specific: Compare logs and alert parsing across language settings. Capture the visible message, exit status, and any relevant side effects. Repeat with the source language to identify unwanted behavior changes. If a translated statement predicts success but the program rejects the command, the test has failed even if the grammar is excellent. When possible, let a target-language reader explain what action they believe the command will perform before it runs.
A complete workflow for one multilingual command
Start with one narrow task, not the entire application. Select parcel-audit’s most useful command and record the source-language input, expected parser values, visible guidance, output and failure cases. Mark each message as library-owned, app-owned, domain-generated or machine-readable. Choose a primary locale and one additional language with enough variation to expose layout and grammar problems.
Next, create a translation table with stable keys and comments explaining ambiguous terms. For example, “check” might mean inspect without writing, validate against a rule or confirm that an external service responded. The message should state the precise operation. Distinguish a result that is “valid under this rule” from one that is “approved,” because the second may imply a human decision or authority the program does not have. Keep every placeholder typed and supply realistic examples.
Then test the smallest real journey. A user reads help, invokes the tool with a valid path, encounters one preventable mistake, finds an actionable correction and reaches an accurately reported result. Observe whether they understand the next step without a developer translating the instruction for them. Record confusion as a usability defect, not an argument that the reader should learn the source language.
Finally, run the same journey from the packaged release in a noninteractive environment. Confirm that an absent locale catalog has a predictable fallback and does not turn an error into success. Inspect raw stdout for data consumers, stderr for failure messages, and a fresh temporary directory for unexpected writes. This combination verifies meaning, software behavior and distribution completeness.
Four-week implementation and maintenance plan
Week one: cover the CLI tree
Record all commands, builders, options, descriptions, examples, validation and completion. Check source-language behavior and script contracts.
Deliver a small, reviewable artifact at the end of this stage: a message inventory or test transcript, a version-controlled catalog, a user-tested interaction, or a release matrix. Keep evidence attached to the exact command and installed dependency version. A good stage finishes with a question answered by observation, not merely a percentage of text marked translated.
Week two: locale architecture
Implement explicit locale precedence, yargs built-in strings and application catalogs. Validate updateStrings keys and fallback using the installed version.
Deliver a small, reviewable artifact at the end of this stage: a message inventory or test transcript, a version-controlled catalog, a user-tested interaction, or a release matrix. Keep evidence attached to the exact command and installed dependency version. A good stage finishes with a question answered by observation, not merely a percentage of text marked translated.
Week three: international user tests
Run translated help, unknown flags, invalid manifests, Unicode paths, long messages, RTL scripts, piping and command completion.
Deliver a small, reviewable artifact at the end of this stage: a message inventory or test transcript, a version-controlled catalog, a user-tested interaction, or a release matrix. Keep evidence attached to the exact command and installed dependency version. A good stage finishes with a question answered by observation, not merely a percentage of text marked translated.
Week four: distribution verification
Use npm pack, install clean, check included resources, process statuses, stdout schemas and a cross-locale regression matrix.
Deliver a small, reviewable artifact at the end of this stage: a message inventory or test transcript, a version-controlled catalog, a user-tested interaction, or a release matrix. Keep evidence attached to the exact command and installed dependency version. A good stage finishes with a question answered by observation, not merely a percentage of text marked translated.
Frequently asked questions
Does yargs have built-in locale support?
Yes. The documented API includes locale and detectLocale, with built-in localized strings for parts of generated help. Your own descriptions still need explicit handling.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
What is updateStrings for?
It overrides selected yargs default strings. When specifying a locale explicitly, the documentation says to do so before updateStrings.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
Can I change command names into another language?
Only by deliberately adding supported aliases or commands. Ordinary translation of help should preserve the published command grammar.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
How should a CLI choose its language?
Document precedence among an explicit argument, app preference, OS locale and fallback. Avoid surprises for scripts that depend on stable behavior.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
What about plural words in app results?
Use a dedicated application message catalog with target-language plural rules; do not rely on yargs translating business-domain messages.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
How do I preserve JSON compatibility?
Keep keys, codes, enum values and schemas unchanged. Human explanations can be localized on separate channels or in explicitly defined fields.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
Is terminal Unicode rendering guaranteed?
No. Fonts, terminal encoding, cell width and bidirectional text can affect display. Test representative terminals and scripts.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
How should I test the npm release?
Pack and install the exact published artifact into a clean environment, then run help, errors, completion, locale fallback and machine-output tests.
For parcel-audit, verify this answer using the declared command contract and the exact distributed program. When documentation and a real test disagree, investigate the discrepancy instead of changing help to conceal it. The desired outcome is a reader who can form an accurate expectation and recover independently.
Sources and further reading
The official sources below provide API details and are the appropriate starting point when you need version-specific behavior. This guide explains how to reason about the work; it does not replace the maintained library documentation. All product and file examples here are hypothetical.
Explore related eduKateSG resources: Translate Like a Pro series index; Master Art of Translation — complete system; and the previous guide to Elixir OptionParser localization. These links lead to broader translation principles and adjacent command-line implementation cases, rather than duplicating this framework’s specific technical questions.
Final checklist and next step
- A real user can distinguish inspection from modification and success from failure.
- Every published help example invokes accepted tokens and documented behavior.
- Library-generated help and application-owned messages were both reviewed.
- Locale precedence and missing-resource fallbacks were tested.
- Numbers, identifiers, machine schemas and return statuses remain stable.
- Errors identify the rejected input and a legitimate recovery path.
- Unicode, bidirectional text, narrow terminals and redirected output were checked where relevant.
- The exact packaged release passes source-language and target-language tests.
The most useful next step is modest: select one common yargs command, collect its help and two genuine failure paths, and walk through them with a reader in the target language. Fix the first misunderstood action before translating the next screen. Professional command-line localization is not the replacement of visible English words; it is preserving what the tool does while making its meaning accessible to more people.