summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp13
-rw-r--r--src/utils/stringutils.h2
2 files changed, 15 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();
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index c6eb08a6c..5cb726eef 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -188,6 +188,8 @@ std::string combineDye2(std::string file, std::string dye);
std::vector<std::string> getLang();
+std::string getLangSimple();
+
std::string packList(std::list<std::string> &list);
std::list<std::string> unpackList(const std::string &str);