fix: use LANG prefix instead of full value #652

Merged
3wordchant merged 2 commits from fix/3wc/651-locale-name into main 2025-09-05 21:12:22 +00:00

View File

@ -36,6 +36,10 @@ func LoadLocale() *gotext.Mo {
}
locale := os.Getenv("LANG")
if lastUnderscore := strings.LastIndex(locale, "_"); lastUnderscore != -1 {
locale = locale[0:lastUnderscore]
}
if locale != "" {
if slices.Contains(linguas, locale) {
Locale = locale