Merge pull request #1499 from raven02/patch-3

New Language button and more user friendly
This commit is contained in:
Henrik Rydgård committed 2013-04-23 12:14:17 -07:00
commit 30eade8b22
1 file changed
+41 -2
+41 -2
View File
@@ -694,7 +694,8 @@ void LanguageScreen::render() {
}
VGrid vlang(50, 100, dp_yres - 50, 10, 10);
std::string text;
for (size_t i = 0; i < langs_.size(); i++) {
std::string code;
size_t dot = langs_[i].name.find('.');
@@ -704,8 +705,46 @@ void LanguageScreen::render() {
std::string buttonTitle = langs_[i].name;
if (!code.empty())
buttonTitle = code;
if (buttonTitle == "ja_JP")
text = "日本語" ;
else if (buttonTitle == "fr_FR")
text = "Français";
else if (buttonTitle == "es_ES" || buttonTitle == "es_LA")
text = "Español";
else if (buttonTitle == "de_DE")
text = "Deutsch";
else if (buttonTitle == "it_IT")
text = "Italiano";
else if (buttonTitle == "ru_RU")
text = "русский";
else if (buttonTitle == "ko_KR")
text = "한국의";
else if (buttonTitle == "pt_Br")
text = "Português";
else if (buttonTitle == "zh_TW")
text = "繁體中文";
else if (buttonTitle == "zh_CN")
text = "简体中文";
else if (buttonTitle == "en_US")
text = "English";
else if (buttonTitle == "gr_EL")
text = "ελληνικά";
else if (buttonTitle == "he_IL")
text = "עברית";
else if (buttonTitle == "hu_HU")
text = "Magyar";
else if (buttonTitle == "nl_NL")
text = "Nederlands";
else if (buttonTitle == "pl_PL")
text = "Polski";
else if (buttonTitle == "sv_SE")
text = "Svenska";
else if (buttonTitle == "tr_TR")
text = "Türk";
else
text = buttonTitle;
if (UIButton(GEN_ID_LOOP(i), vlang, LARGE_BUTTON_WIDTH - 40, 0, buttonTitle.c_str(), ALIGN_TOPLEFT)) {
if (UIButton(GEN_ID_LOOP(i), vlang, LARGE_BUTTON_WIDTH - 30, 0, text.c_str(), ALIGN_TOPLEFT)) {
std::string oldLang = g_Config.languageIni;
g_Config.languageIni = code;