summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 1035426..dd75808 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -169,18 +169,21 @@ func TestUILanguageLoadsPL(t *testing.T) {
}
}
-func TestUILanguageNormalizesUnknown(t *testing.T) {
+func TestUILanguagePreservesAnyCode(t *testing.T) {
+ // Any ui_language code is kept (lower-cased): it drives day/saint-name
+ // localisation via names/<code>.ini. The UI chrome, resolved through
+ // i18n.Get, still falls back to English for a code it has no table for.
dir := t.TempDir()
t.Setenv("XDG_CONFIG_HOME", dir)
os.MkdirAll(filepath.Join(dir, "lectio"), 0o755)
os.WriteFile(filepath.Join(dir, "lectio", "config.toml"),
- []byte("ui_language = \"bogus\"\n"), 0o644)
+ []byte("ui_language = \"FR\"\n"), 0o644)
cfg, err := Load()
if err != nil {
t.Fatal(err)
}
- if cfg.UILanguage != "en" {
- t.Errorf("UILanguage = %q, want %q (normalized from bogus)", cfg.UILanguage, "en")
+ if cfg.UILanguage != "fr" {
+ t.Errorf("UILanguage = %q, want %q (lower-cased, not clamped)", cfg.UILanguage, "fr")
}
}