diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-23 18:26:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-23 18:26:41 +0300 |
commit | 7d60bf1c04fce4ed16144aece76e594e0e217960 (patch) | |
tree | d2831dcbbdf6b7bd3ad89a9e0571b25afa5caad0 /src/utils/stringutils.cpp | |
parent | 20ffb556085e519f98a96f00257ee6b837116a8e (diff) | |
download | plus-7d60bf1c04fce4ed16144aece76e594e0e217960.tar.gz plus-7d60bf1c04fce4ed16144aece76e594e0e217960.tar.bz2 plus-7d60bf1c04fce4ed16144aece76e594e0e217960.tar.xz plus-7d60bf1c04fce4ed16144aece76e594e0e217960.zip |
Add support for request client language from server.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index b855e3b04..26accbc7d 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -509,6 +509,19 @@ std::vector<std::string> getLang() return langs; } +std::string getLangSimple() +{ + std::string lang = config.getValue("lang", "").c_str(); + if (lang.empty()) + { + char *lng = getenv("LANG"); + if (!lng) + return ""; + return lng; + } + return lang; +} + std::string packList(std::list<std::string> &list) { std::list<std::string>::const_iterator i = list.begin(); |