PureScript optparse localization means translating command-line help, option descriptions, error context and completion guidance without changing the argument parser’s real meaning. For developers searching for purescript-optparse, Options.Applicative, strOption, switch, ParserInfo, execParser, helper, subparser and multilingual CLI testing, the most important distinction is between what the application explains and what the executable accepts. A good localization preserves literal –flags, default behavior and typed values while making the generated guidance easier for new readers to follow.
Consider a small greeting preview tool written in PureScript. It accepts –hello TARGET, a –quiet Boolean switch and an optional –enthusiasm INT with a documented default. A French or Hindi description can explain each field, but its translation does not automatically rename the accepted long option or change the reader’s numerical input grammar. PureScript’s applicative parser composition can create structured values from command-line inputs, and the optparse library can generate usage and support completions. The application must still decide how locales, business messages and user examples are managed.
This guide works through the relationship between Parser, ParserInfo, modifiers, helper, execParser, customExecParser and execParserPure, then explains command groups, help preferences, completion and international terminal behavior. It includes independent debugging investigations, reader-tested examples, a four-week implementation plan and primary API references. The goal is to teach how to move meaning into another language without breaking the grammar, the underlying typed result or the command a person will actually copy.
Quick answer: translate the explanation, not the accepted parser grammar
- Keep literal long and short option names stable.
- Use ParserInfo and helper consistently with the actual executable.
- Compare ParserResult under valid and invalid input.
- Review commands, completion, defaults and multilingual terminal output.
- Run acceptance fixtures against a packaged release.
The teaching scenario is intentionally harmless: an example greeting program that displays a result rather than changing files. Distinguish source-language description from user-supplied data. Check the exact package version when adapting code samples, as library details may differ between releases.
1. Parser declarations express executable meaning
In purescript-optparse, a Parser a describes input that can yield a value of type a when parsing succeeds. The package uses Applicative and Alternative composition, so separately described options can be combined into a coherent record or sum type. This structure matters because the visible label, the modifier describing a switch and the resulting PureScript value have distinct roles. Translating a description in a help modifier is not equivalent to altering long “hello” or short ‘q’. Read the parser declaration before editing any usage table, and keep the dependency version visible in test records.
2. The documented greeting example is an ideal starting point
The upstream quick start defines a Sample with hello, quiet and enthusiasm fields. It uses strOption with long “hello” and metavar “TARGET”, switch with long “quiet” and short ‘q’, and option int with a default enthusiasm value. The example is especially useful for language review because it distinguishes mandatory input, a Boolean switch and an optional typed setting. A translator can explain all three in natural language without changing the parser. Every published command should be executable against a small safe program that prints a greeting rather than touching sensitive data.
3. ParserInfo connects a parser to public help
A Parser is not identical to the complete command-line presentation. The info function wraps a parser into ParserInfo with properties such as fullDesc, progDesc and header. These elements contain human-facing explanations that may be translated, while the composed parser continues to determine recognized tokens. The helper combinator adds a help route, commonly used through sample <**> helper. A writer should never promise –help if the actual parser has not included it through the chosen integration. Test full help and shorter error usage separately: they may include different levels of detail.
4. Runners control failure and output behavior
The package documents execParser for ordinary effectful command-line operation, customExecParser for preferences and execParserPure for controlled pure parsing of an argument array. With the pure runner, ParserResult must be handled correctly; upstream documents handleParseResult and overFailure for appropriate behavior. These APIs give an excellent test boundary. Rather than comparing translated screenshots alone, create fixtures for missing –hello, invalid –enthusiasm, unexpected input and valid combinations. Record the typed result or failure classification and confirm that language changes do not mutate these outcomes.
5. Commands and aliases need explicit parser definitions
Subcommands are composed through subparser and command, with each command carrying a ParserInfo. The documentation also describes hsubparser and optional command-group presentation. A human translation of a command label does not establish an executable alias. The upstream tutorial even demonstrates distinct registered synonyms, making the difference useful to teach: add the name in the parser if it should run, and then test collisions, scope and help. Keep the printed command list consistent with the actual parser tree. A translated heading should not obscure a child command’s valid name.
6. Modifiers carry essential semantic details
The modifiers long, short, help, metavar, value, showDefault and related builders affect different portions of the interface. Some declare accepted grammar; others set explanatory text, display labels or defaults. Treat them differently in review. For instance, a translated value description may be valuable, but a default shown in generated usage must remain the real default. An option int still expects the numeric grammar of its reader. If a localized document suggests values the reader cannot parse, it has changed the user’s expectations without changing the program.
7. Help preferences and error visibility are choices
The upstream documentation mentions preferences such as showHelpOnError and showHelpOnEmpty, and an optional disambiguation mode. These are not merely translation settings. They influence when help appears, how incomplete commands are presented or how names are recognized. A target-language user may appreciate more context after an error, but enabling it is a software behavior decision that deserves tests. Do not claim that selecting a locale automatically turns a preference on. Explicitly document the configured behavior and run the command with incomplete input to prove the prose.
8. Completion is an additional reader-facing surface
The library documents completion support for bash, zsh and fish when using its runner family. Completion can display candidate strings and insert tokens, which makes it part of a localization audit. A candidate description may be translated, but the inserted command or option must match recognized grammar. Test each supported shell with real startup integration, including nested commands and Unicode descriptions. Do not extrapolate completion support to every shell or platform from one feature paragraph. Any proposed localized alias also needs the correct insertion and acceptance path.
9. Unicode and shell boundaries still matter
PureScript runs in a host environment, typically through compiled JavaScript, and command-line argument encoding and display may depend on the runtime and terminal. A valid UTF-8 description does not prove every Unicode filename or pasted argument survives unchanged. Use ASCII, accented, CJK and RTL samples. Compare Unicode display, argv identity and final application behavior separately. Show code tokens isolated from right-to-left prose so readers copy the intended characters. Narrow terminals and non-color environments are especially valuable for making sure help remains navigable.
10. Release quality is a practical learning outcome
A localization is complete when a reader can discover the right command, supply values and recover from a predictable mistake in the language of the guide. Keep an English baseline and two target locales, record the exact package version, and test packaged distribution. Ask someone unfamiliar with the source English to run a harmless example and describe what the program will do. If they infer a different accepted flag, an incorrect default or a destructive side effect that the program does not have, revise the text. Accuracy and successful action outweigh the number of translated lines.
39 practical PureScript optparse localization investigations
1. Long option translated into unsupported name
A German usage table replaces –hello with –hallo but the parser retains long “hello”.
Keep –hello literal and translate its purpose, or add a real alias through parser definitions after compatibility review.
Execute both spellings and compare ParserResult.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
2. Short switch disappears
The –quiet option has short ‘q’, yet the translated guide never mentions -q.
Document both registered spellings and avoid inventing a local-language initial.
Run –quiet and -q against the same fixture.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
3. Required hello becomes optional
A translation suggests –hello TARGET may be omitted, but the upstream example has no default.
State the requirement and give a minimal runnable greeting command.
Run without –hello and inspect the missing-option message.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
4. TARGET treated as a literal value
A beginner types TARGET instead of substituting a name because metavar was not explained.
Describe metavar as a displayed value hint and show a concrete harmless replacement.
Copy the example and inspect the parsed hello field.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
5. Quiet described as a string value
An editor writes –quiet true even though switch represents presence or absence.
Explain Boolean switch semantics and keep the accepted syntax visible.
Compare no flag, –quiet and –quiet true.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
6. Default enthusiasm changed in prose
Help says the default is 10 while the parser uses value 1.
Derive default explanations from actual declarations and keep showDefault accurate.
Run with no enthusiasm value and with a supplied integer.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
7. Numeric locale format fails
A translated example suggests a decimal-comma value for option int, although the integer reader does not accept it.
Use tested integer forms and translate only human descriptions of the scale.
Test 2, 2,5, text and overflow values.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
8. ParserInfo mistaken for the parser
A sample passes a raw Parser where execParser expects ParserInfo, causing a compilation or type error.
Wrap the parser with info and documented modifiers before running it.
Compile and execute the exact tutorial snippet.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
9. helper omitted
The prose promises –help, but the application’s parser never composes helper.
Add helper through the documented composition when the product intends help access.
Run –help in a clean binary and record whether full usage appears.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
10. Full and short usage confused
A guide reproduces full –help text for every failure even though the configured runner shows brief error usage.
Describe the actual behavior under failure and the configured help preferences.
Compare –help, no args and unknown options.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
11. A command alias exists only in a heading
A local-language command name appears in a translated section but has no command entry in subparser.
Keep registered command names as literals, or implement aliases explicitly in the parser.
Run root and child commands in both spellings.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
12. Command groups become invisible
A translated commandGroup label hides useful commands behind confusing categorization and readers cannot locate the right child.
Review grouping labels and hidden modifiers against actual command lists and show a clear route.
Generate root and child help for every group.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
13. Wrong child ParserInfo reused
Two commands have different accepted arguments but a documentation template describes the same child parser for both.
Keep each command paired with its correct info and tested sample invocation.
Run help and valid input for each child independently.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
14. All branches assumed same type
A tutorial combines command parsers with incompatible result types and promises successful compilation.
Use an appropriate shared sum type for child commands and explain the constructors in ordinary language.
Compile the small grouped example with the pinned package version.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
15. Applicative order oversimplified
A translation implies options are simply evaluated as sequential instructions rather than composed parsing specifications.
Explain the typed result assembled by the parser and test any ordering constraints in real invocations.
Run accepted input permutations and compare parsed output.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
16. Alternative branch becomes ambiguous
Two alternatives match related syntax, and a localized explanation does not tell users which option selects a branch.
Clarify the accepted alternatives and make valid examples distinguishable rather than inventing a precedence rule.
Test each branch plus an intentionally ambiguous input.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
17. An optional combinator is treated as required
The guide says a value must be supplied even though optional permits absence.
Document how a Maybe result represents the omitted state and what the application does next.
Run both absent and present fixtures.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
18. value default mistaken for a translated label
An editor changes a semantic default while trying to improve the displayed wording.
Keep value tied to application behavior and translate only the accompanying explanation.
Compare the typed result before and after the wording change.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
19. showDefault exposes stale value
The help displays an outdated default because the source parser changed and the release uses stale assets.
Rebuild the parser and compare generated text with the actual value produced on omission.
Run a zero-argument fixture and inspect both help and result.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
20. showHelpOnError assumed automatic
A translated guide says every parse error displays full help, but the preference was not enabled.
Document the selected preference and adjust it deliberately if user research supports the change.
Trigger missing and invalid input and capture the exact usage shown.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
21. showHelpOnEmpty misinterpreted
A parent command without a child produces a message inconsistent with the guide’s promised welcome screen.
Explain the configured empty-input behavior and how it differs from –help.
Run root and child invocations with no remaining input.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
22. Disambiguation overstated
Documentation says abbreviated long options are always allowed, while disambiguate is not enabled by default.
Document only tested accepted names and the chosen parser preference.
Try an unambiguous prefix and a conflicting prefix in the configured runner.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
23. Pure runner discards failures
A test uses execParserPure but treats every ParserResult as a successful value.
Check success and failure constructors and use documented result handlers when moving to effects.
Test known good and invalid input arrays.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
24. Error handling changes exit semantics
Custom code prints a friendly translated failure but exits successfully, confusing calling scripts.
Preserve failure classification and the appropriate nonzero status when handling results.
Capture exit codes for help, invalid input and valid input.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
25. overFailure edits wrong message
A team applies a help transformation globally and changes messages for successful commands unnecessarily.
Scope modifications to failures and document what remains library-owned.
Compare success, full help and several error categories.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
26. Shell completion inserts translated token
A completion description is localized, but its candidate inserts a non-registered flag spelling.
Keep inserted tokens canonical and translate only human labels where supported.
Run completion and then execute the inserted command.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
27. Completion support generalized to all shells
An article asserts every terminal has automatic completion without configuration.
Limit claims to documented bash, zsh and fish support and actual installation steps.
Test each supported shell with the executable integration.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
28. Completion and nested commands drift
The help describes a child command that completion never suggests because definitions or packaging differ.
Verify generated completion against the same parser used by runtime help.
Exercise parent, child and partial option completions.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
29. A CJK phrase is truncated
A renderer or outer wrapper measures bytes rather than display width and slices a multibyte phrase.
Preserve complete Unicode text and use readable wrapping rather than byte-count truncation.
Inspect long Japanese descriptions at several widths.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
30. Arabic code tokens look reordered
Right-to-left prose makes –help appear attached to another word and harms copy-paste.
Isolate literal commands in code blocks and keep prose separate.
Have a native reader copy tokens and inspect parsed argv.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
31. Shell quoting absent for spaces
A filename example with spaces reaches the parser as multiple arguments.
Show quoting for each supported shell and distinguish it from optparse behavior.
Run quoted and unquoted forms and inspect input arrays.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
32. Unicode argv differs from screen text
The runtime displays non-ASCII help properly but receives a damaged filename argument from the host environment.
Test argument decoding separately from output rendering and preserve user input identity.
Use non-ASCII fixture paths and compare the typed result.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
33. Example changes a file unexpectedly
A tutorial adapted from a command called add or commit is described as a harmless preview while the real tool writes data.
Use read-only examples for initial teaching and state actual side effects precisely.
Run against disposable fixtures and inspect modifications.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
34. Localization replaces enum input tokens
A builder accepts stable labels but translated usage substitutes natural-language descriptions as values.
Keep machine tokens literal and explain their meaning alongside them.
Execute every advertised label and verify parser acceptance.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
35. Header, footer and progDesc contradict
The translated header says read-only inspection while the footer implies records will be deleted.
Review all ParserInfo descriptions as one coherent promise about the same command.
Ask a reader to predict side effects before execution.
Keep an evidence trail for ownership. A Parser modifier can declare accepted syntax, a help modifier can supply prose, a runner can determine failure presentation and the host shell can transform tokens before parsing. Identifying the correct layer leads to a smaller fix and prevents translators from being asked to solve a software defect with words.
36. Unreviewed help preference changes layout
A team enables verbose full help on every failure and narrow terminals become overwhelming.
Compare recovery speed and readability at the actual target width before changing preferences.
Run short and full usage paths on limited terminals.
Capture the exact token array, selected locale, dependency version, parser result, displayed message and exit status where applicable. This makes a reproducible record that a maintainer can use after an upgrade. A translation review should not stop at whether a sentence is natural: the rendered example must lead to a real accepted input.
37. Old examples break after upgrade
A dependency upgrade changes completion or generated error formatting without a new localization review.
Pin versions and replay a semantic command corpus rather than trusting old screenshots.
Compare accepted inputs, results, codes and translated descriptions across releases.
Ask what the reader is trying to decide. They need to know which input is required, what can be omitted, what is a literal switch and which pieces are values they provide. Use a direct explanation of the next action. Precise language about defaults and invalid values is often more valuable than retaining the source sentence’s structure.
38. A translated example is not executable
A publishing tool converts ASCII dashes or quotes in code to typographic variants.
Keep executable syntax in literal code blocks and review the final rendered page.
Copy every command from the public article into a test shell.
A command-line parser is effectively a public interface. Shell scripts, tutorials, completion definitions and other programs may depend on exact spellings, regardless of the user’s preferred language. Treat translation as a change in explanations unless software engineering explicitly authorizes changes to the grammar and provides compatibility tests.
39. Resource files are missing in release
Translation catalogs work in development but are not present alongside the packaged PureScript program.
Audit distribution assets and fallback behavior for application-controlled messages.
Install in a clean environment and test both supported and unknown locales.
Internationalization has more than one boundary: source strings, generated usage, argument input, terminal rendering and application effects. Verify each layer independently with one longer translation and one non-Latin script. A line wrap can differ harmlessly; a lost option, incorrect value or mangled path cannot.
Frequently asked questions
Does purescript-optparse translate help automatically?
It generates help and supports descriptions, but selecting and maintaining target-language strings is an application decision. The generated library interface should not be confused with a full automatic translation service.
Why use ParserInfo?
ParserInfo wraps a Parser with presentation metadata such as header, progDesc and fullDesc. Runners like execParser use it to generate help and handle arguments.
What does helper do?
The documented helper combinator adds a –help route to a parser. You must actually include it in the program if the guide promises that spelling.
Are long and short option names translatable?
They are executable tokens. Translate their explanations, and create tested aliases only when compatibility decisions justify additional spellings.
How can I test without starting process effects?
Use the documented execParserPure approach for input-array fixtures and compare ParserResult values. Effectful runs remain necessary to verify exit behavior and final terminal output.
Can a program localize child command names?
Yes, by registering real command synonyms or aliases through the parser. A translated heading alone does not make a name runnable.
What about completion in other languages?
Check the documented bash, zsh and fish integration, then test that inserted candidate tokens are accepted. Descriptions and executable completions must be reviewed separately.
What makes a release useful for readers?
The published guidance should let target-language readers find valid commands, supply typed values and recover from errors on the actual packaged program.
Four-week implementation plan
Week 1 — baseline the typed interface
Create a small greeting program with a required strOption, a Boolean switch and an optional integer with a real default. Wrap the Parser in ParserInfo and include the helper route. Compile it and run ordinary help, missing input, invalid number and one successful invocation. Save typed ParserResult fixtures using execParserPure where useful, then capture effectful stdout, stderr and status. Inventory command tokens separately from help, placeholders, defaults and application messages. Choose two target languages and one non-ASCII test value. The baseline should show what can be translated safely without changing successful parsing.
Week 2 — review descriptions and help routes
Translate header, progDesc, descriptions and recovery instructions in context, keeping accepted long and short spellings literal. Explain required, optional and default values accurately. If the program uses subparser or command groups, render root and child help. Ask a target-language reader to select a valid input and run the example without assistance. Compare the page’s rendered code blocks with what the shell actually accepts. Do not assume enabling locale changes showHelpOnError or other preferences. Record which messages are owned by the application and which originate in the dependency.
Week 3 — exercise failure, completion and Unicode
Test an unknown option, missing –hello, invalid –enthusiasm and ambiguous prefixes if the configured preferences allow them. Generate or exercise bash, zsh and fish completion only where installed; verify inserted tokens parse correctly. Test CJK descriptions, composed accents and right-to-left prose beside literal command tokens. Observe narrow terminal wrapping and cross-platform argument encoding. Repeat the tests against the packaged program with no development-only resources. Avoid brittle snapshots based solely on whitespace; preserve the semantic command and error evidence.
Week 4 — test learning, repair and update resilience
Give a target-language reader three tasks: find the correct invocation, run a safe greeting and repair an invalid number. Ask what they think the command will do before execution and whether help describes the outcome. Improve passages that cause wrong predictions, then run the same fixtures in each supported locale. Assign ownership for Parser modifiers, localized descriptive strings, runner preferences and shell completion assets. Store the reviewed dependency version, platform, exact argv and results. Future upgrades should begin with this corpus instead of an assumption that generated text will remain unchanged.
What successful localization means
A successful PureScript optparse translation preserves a typed program’s real grammar while making its choices understandable. The reader knows which tokens are executable, which values are placeholders, what defaults apply and how an error can be fixed. ParserInfo, helper and the runner family provide a structured path for help and diagnostics, but they cannot replace honest testing of language, terminal and distribution choices. The standard is a real task completed safely in the reader’s language.