From d6c2460155fd7ab51481f36930a3d73c032bba29 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 5 Nov 2011 16:34:36 +0300 Subject: Fix current language detection if using custom language. --- src/utils/stringutils.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/utils/stringutils.cpp') diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 6c50d4019..39f14a646 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -22,6 +22,8 @@ #include "utils/stringutils.h" +#include "configuration.h" + #include #include #include @@ -487,11 +489,16 @@ std::string combineDye2(std::string file, std::string dye) std::vector getLang() { std::vector langs; - char *lng = getenv("LANG"); - if (!lng) - return langs; - std::string lang(lng); + std::string lang = config.getValue("lang", "").c_str(); + if (lang.empty()) + { + char *lng = getenv("LANG"); + if (!lng) + return langs; + lang = lng; + } + int dot = lang.find("."); if (dot != (signed)std::string::npos) lang = lang.substr(0, dot); -- cgit v1.2.3-70-g09d2