Skip to content

L10n: falls back to English when the auto-detected locale is unsupported - #2528

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
wehrwolfmann:key-language-fallback
Aug 18, 2026
Merged

L10n: falls back to English when the auto-detected locale is unsupported#2528
CarterLi merged 1 commit into
fastfetch-cli:devfrom
wehrwolfmann:key-language-fallback

Conversation

@wehrwolfmann

Copy link
Copy Markdown
Contributor

Summary

--key-language with an empty value, and "language": null in the config, mean "use my
system locale". If that locale has no translation, fastfetch printed nothing and exited 477
instead. So one config file works on my machine and aborts on a Dutch or Ukrainian one, and
in any LC_ALL=POSIX script or CI job.

$ LC_ALL=uk_UA.UTF-8 fastfetch --key-language ""     # before
Error: Language 'uk_ua' is not supported
$ echo $?
221
$ LC_ALL=uk_UA.UTF-8 fastfetch --key-language ""     # after
OS: CachyOS x86_64
...

Related issue

Follow-up to the second point in #2503 (comment) — you fixed pt there, this is the fallback half.

Changes

  • An auto-detected locale that reaches error: now returns English instead of exit(477).
  • An explicit --key-language value still errors, so typos and bare zh are still reported.
  • Help remark mentions the fallback.

Testing

CachyOS, x86_64, glibc 2.42, gcc 15. Differential over all 533 locale names glibc ships
(/usr/share/i18n/locales + SUPPORTED), --key-language "", before vs after:

count
identical 179
aborted before, works now 354
regressions 0

Spot checks unchanged: ru_RU.UTF-8Операционная система, pt_BRSistema operacional,
zh_CN/zh_TW → Chinese, C → English. Explicit --key-language zh / nl_NL / xx still
exit 221. "language": null under uk_UA.UTF-8 now prints instead of aborting.

Screenshots

No visual changes for supported locales.

Checklist

  • I have tested my changes locally.

--key-language with an empty value (and "language": null in the config)
asks for the system locale, not for a specific language. When that locale
has no translation, fastfetch aborted with exit 477 instead of printing
anything, so the same config broke on every locale outside the twelve
supported ones, and under LC_ALL=C variants such as POSIX.

Auto-detected locales now fall back to English. An explicitly requested
language still errors out, so typos and zh are still reported.
@CarterLi
CarterLi merged commit e5b6e36 into fastfetch-cli:dev Aug 18, 2026
22 of 23 checks passed
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.

2 participants