src/system/helpers.cpp: Add function Lang2ISO639_1()

Origin commit data
------------------
Branch: ni/coolstream
Commit: 53ef02ad2f
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-03-04 (Fri, 04 Mar 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2016-03-04 13:57:28 +01:00
parent 05ba3cedff
commit 41784d58c7
2 changed files with 34 additions and 0 deletions

View File

@@ -944,3 +944,36 @@ std::string getJFFS2MountPoint(int mtdPos)
fclose(fd);
return "";
}
std::string Lang2ISO639_1(std::string& lang)
{
std::string ret = "";
if ((lang == "deutsch") || (lang == "bayrisch") || (lang == "ch-baslerdeutsch") || (lang == "ch-berndeutsch"))
ret = "de";
else if (lang == "english")
ret = "en";
else if (lang == "nederlands")
ret = "nl";
else if (lang == "slovak")
ret = "sk";
else if (lang == "bosanski")
ret = "bs";
else if (lang == "czech")
ret = "cs";
else if (lang == "francais")
ret = "fr";
else if (lang == "italiano")
ret = "it";
else if (lang == "polski")
ret = "pl";
else if (lang == "portugues")
ret = "pt";
else if (lang == "russkij")
ret = "ru";
else if (lang == "suomi")
ret = "fi";
else if (lang == "svenska")
ret = "sv";
return ret;
}