diff options
author | Andreas Zelend <andiz1@web.de> | 2013-09-29 15:13:37 -0700 |
---|---|---|
committer | Andreas Zelend <andiz1@web.de> | 2013-09-29 15:13:37 -0700 |
commit | 494c67ae1fef4c31f613d724d3e3e67bdf2a4d90 (patch) | |
tree | d3c95899a1a945d5bf9d5f68984ef544a9f18b1e | |
parent | e3a642ff765454fec3b4a93e82ea6714d9099998 (diff) | |
parent | b51ab27a9c289ebf504f45f48845ed09fef01b3d (diff) |
Merge pull request #3329 from ace20022/lang_fixesGotham_alpha8
[Fix] Fix preferred audio/subtitle language mechanism.
-rw-r--r-- | xbmc/Application.cpp | 2 | ||||
-rw-r--r-- | xbmc/utils/LangCodeExpander.cpp | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 266b9d8488..94e5e9e74b 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -763,6 +763,8 @@ bool CApplication::Create() CLog::Log(LOGINFO, "load language info file: %s", strLangInfoPath.c_str()); g_langInfo.Load(strLangInfoPath); + g_langInfo.SetAudioLanguage(CSettings::Get().GetString("locale.audiolanguage")); + g_langInfo.SetSubtitleLanguage(CSettings::Get().GetString("locale.subtitlelanguage")); CStdString strLanguagePath = "special://xbmc/language/"; diff --git a/xbmc/utils/LangCodeExpander.cpp b/xbmc/utils/LangCodeExpander.cpp index 3923318658..5ca700e059 100644 --- a/xbmc/utils/LangCodeExpander.cpp +++ b/xbmc/utils/LangCodeExpander.cpp @@ -213,6 +213,15 @@ bool CLangCodeExpander::ConvertToThreeCharCode(CStdString& strThreeCharCode, con } else if (strCharCode.size() > 3) { + for(unsigned int i = 0; i < sizeof(g_iso639_2) / sizeof(LCENTRY); i++) + { + if (strCharCode.Equals(g_iso639_2[i].name)) + { + CodeToString(g_iso639_2[i].code, strThreeCharCode); + return true; + } + } + CStdString strLangInfoPath; strLangInfoPath.Format("special://xbmc/language/%s/langinfo.xml", strCharCode.c_str()); CLangInfo langInfo; |