diff options
author | Michał Zieliński <michal@zielinscy.org.pl> | 2012-12-14 10:09:38 -0800 |
---|---|---|
committer | Michał Zieliński <michal@zielinscy.org.pl> | 2012-12-14 10:09:38 -0800 |
commit | 3b896370045c9d38b5014578a9395a0a95fcb5f1 (patch) | |
tree | 415ffcf5da9f6fb512b93d263871334738d862c1 /src/app/app.cpp | |
parent | 830fc19b8ce4ec6d5beeefd04bd085c35c1b664f (diff) | |
parent | 6946155a5686f19a62157af00746f834bec47448 (diff) | |
download | colobot-3b896370045c9d38b5014578a9395a0a95fcb5f1.tar.gz colobot-3b896370045c9d38b5014578a9395a0a95fcb5f1.tar.bz2 colobot-3b896370045c9d38b5014578a9395a0a95fcb5f1.zip |
Merge pull request #83 from OdyX/fix_i18n_from_env
Inherit translation setting from environment.
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r-- | src/app/app.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 81d874d..751ff21 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -132,7 +132,7 @@ CApplication::CApplication() m_dataPath = "./data"; - m_language = LANGUAGE_ENGLISH; + m_language = LANGUAGE_ENV; m_lowCPU = true; @@ -290,9 +290,14 @@ bool CApplication::Create() /* Gettext initialization */ - std::string locale = "C"; + std::string locale = ""; switch (m_language) { + default: + case LANGUAGE_ENV: + locale = ""; + break; + case LANGUAGE_ENGLISH: locale = "en_US.utf8"; break; @@ -314,7 +319,8 @@ bool CApplication::Create() langStr += locale; strcpy(S_LANGUAGE, langStr.c_str()); putenv(S_LANGUAGE); - setlocale(LC_ALL, locale.c_str()); + setlocale(LC_ALL, ""); + GetLogger()->Debug("Set locale to '%s'\n", locale.c_str()); std::string trPath = m_dataPath + "/" + m_dataDirs[DIR_I18N]; bindtextdomain("colobot", trPath.c_str()); |