diff options
author | Didier Raboud <odyx@debian.org> | 2012-12-27 16:13:26 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2012-12-27 16:13:26 +0100 |
commit | 0d825ed613ae62b0ed22a7e7f9ea1f001e3f8ea3 (patch) | |
tree | 29c4b94f0fd48a40c7ad1925d4b307cfc84943f5 | |
parent | 70cb629cc5728398e177c9b6bb7548847ce0be28 (diff) | |
download | colobot-0d825ed613ae62b0ed22a7e7f9ea1f001e3f8ea3.tar.gz colobot-0d825ed613ae62b0ed22a7e7f9ea1f001e3f8ea3.tar.bz2 colobot-0d825ed613ae62b0ed22a7e7f9ea1f001e3f8ea3.zip |
Fix locale's loading
- Always inherit LC_ALL from environment;
- Enforce environment only if the runtime options require it;
-rw-r--r-- | src/app/app.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 118e100..27adcb1 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -312,11 +312,14 @@ bool CApplication::Create() break; } - std::string langStr = "LANGUAGE="; - langStr += locale; - strcpy(S_LANGUAGE, langStr.c_str()); - putenv(S_LANGUAGE); - setlocale(LC_ALL, locale.c_str()); + if (!locale.empty()) + { + std::string langStr = "LANG="; + langStr += locale; + strcpy(S_LANGUAGE, langStr.c_str()); + putenv(S_LANGUAGE); + } + setlocale(LC_ALL, ""); GetLogger()->Debug("Set locale to '%s'\n", locale.c_str()); bindtextdomain("colobot", COLOBOT_I18N_DIR); |