Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

WaterWhisperer
Copy link

This PR fixes issue #8594 .

Previously, binaries installed via cargo install would only embed the English (en-US) locale. This change modifies the uucore/build.rs script to detect the system's locale via the LANG environment variable at compile time. It embeds the corresponding locale file if it exists, in addition to the mandatory English (en-US) fallback.

Verification

I verified this fix by setting my system locale to French (export LANG=fr_FR.UTF-8), for which the yes utility has an existing translation.

  1. Ran cargo build --package uu_yes.
  2. Executed ./target/debug/yes --help.

The command correctly displayed the help text in French, confirming that the build script now successfully embeds the user's system locale.

Testing with a Chinese locale (zh_CN) correctly resulted in a fallback to English, as no Chinese translation file currently exists for the yes utility. This demonstrates the fallback mechanism is working as expected.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant