summaryrefslogtreecommitdiff
path: root/src/locale-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-08-31 14:09:14 +0200
committerLennart Poettering <lennart@poettering.net>2011-08-31 14:10:50 +0200
commit07bceef2a9c520e24da427c7ce500ad36ad37571 (patch)
tree4594865c29d0742e9d4d262d45e501fabfe26e9a /src/locale-setup.c
parent4dc380d16dfbead78de9caaf5104dbc00bac6d75 (diff)
locale: support $LANGUAGE too
$LANGUAGE is a GNU extension that is probably worth supporting, since it allows specifiying an order of languages. https://bugs.freedesktop.org/show_bug.cgi?id=40510
Diffstat (limited to 'src/locale-setup.c')
-rw-r--r--src/locale-setup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/locale-setup.c b/src/locale-setup.c
index 33111da218..41eb50bbba 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -32,6 +32,7 @@ enum {
* using LANG instead. */
VARIABLE_LANG,
+ VARIABLE_LANGUAGE,
VARIABLE_LC_CTYPE,
VARIABLE_LC_NUMERIC,
VARIABLE_LC_TIME,
@@ -49,6 +50,7 @@ enum {
static const char * const variable_names[_VARIABLE_MAX] = {
[VARIABLE_LANG] = "LANG",
+ [VARIABLE_LANGUAGE] = "LANGUAGE",
[VARIABLE_LC_CTYPE] = "LC_CTYPE",
[VARIABLE_LC_NUMERIC] = "LC_NUMERIC",
[VARIABLE_LC_TIME] = "LC_TIME",
@@ -75,6 +77,7 @@ int locale_setup(void) {
"LANG", &variables[VARIABLE_LANG],
#endif
"locale.LANG", &variables[VARIABLE_LANG],
+ "locale.LANGUAGE", &variables[VARIABLE_LANGUAGE],
"locale.LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
"locale.LC_NUMERIC", &variables[VARIABLE_LC_NUMERIC],
"locale.LC_TIME", &variables[VARIABLE_LC_TIME],
@@ -98,6 +101,7 @@ int locale_setup(void) {
if (r <= 0 &&
(r = parse_env_file("/etc/locale.conf", NEWLINE,
"LANG", &variables[VARIABLE_LANG],
+ "LANGUAGE", &variables[VARIABLE_LANGUAGE],
"LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
"LC_NUMERIC", &variables[VARIABLE_LC_NUMERIC],
"LC_TIME", &variables[VARIABLE_LC_TIME],
@@ -212,8 +216,8 @@ int locale_setup(void) {
"LC_IDENTIFICATION", &variables[VARIABLE_LC_IDENTIFICATION],
NULL)) < 0) {
- if (r != -ENOENT)
- log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
}
#endif