L10n: falls back to English when the auto-detected locale is unsupported - #2528
Merged
Merged
Conversation
--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.
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.
Summary
--key-languagewith an empty value, and"language": nullin the config, mean "use mysystem 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=POSIXscript or CI job.Related issue
Follow-up to the second point in #2503 (comment) — you fixed
ptthere, this is the fallback half.Changes
error:now returns English instead ofexit(477).--key-languagevalue still errors, so typos and barezhare still reported.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:Spot checks unchanged:
ru_RU.UTF-8→Операционная система,pt_BR→Sistema operacional,zh_CN/zh_TW→ Chinese,C→ English. Explicit--key-language zh/nl_NL/xxstillexit 221.
"language": nullunderuk_UA.UTF-8now prints instead of aborting.Screenshots
No visual changes for supported locales.
Checklist