summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-12 01:17:09 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-12 01:24:06 +0100
commite22d8a737efff9516b8013cf796dabb750f396d2 (patch)
tree1ec60329f7a93e72d9fe34c0aec12ca51bdbf02e /src
parent4285ff59480d526161905ecdc5fc05b57be7ed58 (diff)
Try to respect LC_NUMERIC even if it doesn't match LANG.
With LANG=en_GB.UTF-8 and LC_NUMERIC=de_DE.UTF-8 I get . as a decimal separator, I think because the setlocale(LC_ALL, "") uses $LANG everywhere. This is not what wxWidgets expects, and not what I expect (other applications use ,). Fix that by respecting LC_NUMERIC explicitly.
Diffstat (limited to 'src')
-rw-r--r--src/lib/i18n_setup_linux.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/i18n_setup_linux.cc b/src/lib/i18n_setup_linux.cc
index 37207e29d..0be066972 100644
--- a/src/lib/i18n_setup_linux.cc
+++ b/src/lib/i18n_setup_linux.cc
@@ -52,6 +52,9 @@ dcpomatic::setup_i18n(string forced_language)
}
setlocale(LC_ALL, "");
+ if (auto num = getenv("LC_NUMERIC")) {
+ setlocale(LC_NUMERIC, num);
+ }
textdomain("libdcpomatic2");
bindtextdomain("libdcpomatic2", mo_path().string().c_str());