uutils / uutils/coreutils

Locale lookup doesn't seem to be working with full region code

Open
#11,948 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Description

Locale lookup appears to be too strict, it doesn't accept just hu.ftl, it needs the hyphen also (hu-HU.ftl). Uutils should just fall back to hu.ftl

Steps to reproduce
  1. git clone https://github.com/uutils/coreutils-l10n
  2. sudo cp uu/users/locales/hu.ftl /usr/share/locales/users/hu.ftl
  3. LANG=hu_HU.UTF-8 uu-users --help (not localized)
  4. sudo cp uu/users/locales/hu.ftl /usr/share/locales/users/hu-HU.ftl
  5. LANG=hu_HU.UTF-8 uu-users --help (localized)

Locale output:

LC_CTYPE="hu_HU.UTF-8"
LC_NUMERIC="hu_HU.UTF-8"
LC_TIME="hu_HU.UTF-8"
LC_COLLATE="hu_HU.UTF-8"
LC_MONETARY="hu_HU.UTF-8"
LC_MESSAGES="hu_HU.UTF-8"
LC_PAPER="hu_HU.UTF-8"
LC_NAME="hu_HU.UTF-8"
LC_ADDRESS="hu_HU.UTF-8"
LC_TELEPHONE="hu_HU.UTF-8"
LC_MEASUREMENT="hu_HU.UTF-8"
LC_IDENTIFICATION="hu_HU.UTF-8"
LC_ALL=

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the uu-users command and trace how LANG=hu_HU.UTF-8 is mapped to files under uu/users/locales and /usr/share/locales/users. Reproduce with uu/users/locales/hu.ftl, then verify that the command falls back to hu.ftl when hu-HU.ftl is absent and localizes --help.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.