Repository navigation
i18n: resolve WPM catalog at the WinuxCmd install root (#1150) - #1151
Merged
Merged
Conversation
caomengxuan666
added a commit
that referenced
this pull request
Oct 10, 2026
…#1152 (#1153) - Delete BUG_FIX_PLAN.md and BUG_FIX_STATUS.md: point-in-time snapshots of the 95-bug audit round (2360/2366 tests, K:/coreutils-issues data sources). The fix campaign is long landed and recorded in git history and the CHANGELOG; the stale counts contradict the current state. - CHANGELOG: replace the empty Unreleased section with entries for the WPM catalog install-root resolution (#1151) and touch -c unmatched literal-glob operands (#1152). Co-authored-by: docs-audit <[email protected]>
This was referenced Oct 10, 2026
caomengxuan666
added a commit
that referenced
this pull request
Oct 10, 2026
…n locale hint (issue #1155) (#1160) Bare 'winuxcmd' printed 193 lines of registration-ordered command summaries with no structure and no discovery guidance. Rework it: - Group all registered commands into nine GNU coreutils-style sections (File operations, Text processing, Compare & patch, Numeric operations, Search tools, Checksums & encoding, Shell utilities, System & process, Terminal & documentation), alphabetical inside each section; uncategorized commands would fall into an 'Other utilities' catch-all so new commands stay visible. - Print a discovery guide before the groups: 'winuxcmd <command> --help', 'winuxcmd help <command>', 'winuxcmd --list-all' and 'wpm search <capability>'. - Add 'winuxcmd --list-all' for the flat alphabetical listing. - Detect the system locale with an injection-friendly precedence (WINUX_LANG > LC_ALL > LC_MESSAGES > LANG > GetUserDefaultLocaleName) and, when it is non-English and the matching WPM i18n catalog (#1151) is not installed, print one hint pointing at 'wpm install winuxcmd-i18n-zh-cn' + WINUX_LANG=zh-CN. English locales, explicit WINUX_LANG=off and installed catalogs stay silent. Command parsing and dispatch are untouched; all 178 registered commands still dispatch (per-command --version loop green) and the winuxcmd unit group passes 36/36, including new tests for section grouping, alphabetical order, bare-vs-list-all parity, and the four locale-hint states.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
catalog()insrc/utils/i18n.cppmlooked up the i18n catalog only next tothe executable:
<exe-dir>/.wpm/i18n/<locale>/catalog.json, where<exe-dir>iswinuxcmd/usr/bin/(the parent ofwinuxcmd.exe).WPM, however, installs i18n package payloads at the WinuxCmd install
root:
winuxcmd/.wpm/i18n/zh-CN/catalog.json— two levels above the exedirectory. The two paths never matched, so translated catalogs were never
loaded and only
WINUX_LANGmattered (with no catalog found, output stayedEnglish). There was no env override for the catalog path either.
Fix
catalog()now probes candidate roots in order:<exe-dir>/.wpm/i18n(unchanged behavior, keeps the verified workaroundfrom the issue working)
<root>/.wpm/i18n, whichcovers the WPM layout
<root>/usr/bin/winuxcmd.exe-><root>/.wpm/i18nThe full-locale path and the language-only fallback (
zh-CN->zh) aretried per root, and the first readable catalog wins.
Verification
winuxcmd.i18n_catalog_found_at_wpm_install_root(
tests/unit/winuxcmd/winuxcmd_unit_test.cpp): builds a<root>/usr/bin/winuxcmd.exe+<root>/.wpm/i18n/zh-CN/catalog.jsonlayout in a temp dir, runs
winuxcmd ls --helpwithWINUX_LANG=zh-CN,and asserts the
common.usagemessage from the catalog is printed. Itfails on the old lookup and passes with this fix.
winuxcmd.*test group: 28/28 passed.(
grep.grep_r_skips_cross_junction_trees_without_crashing,grep.grep_R_warns_and_terminates_on_junction_cycle) are pre-existingenvironment issues (directory symlink creation requires privilege) and
are unrelated to this change.
install root) load translations.
Closes #1150