From 953d2b11057ad236d6fba3edcbef813b038731a1 Mon Sep 17 00:00:00 2001 From: ace20022 Date: Wed, 25 Sep 2013 14:14:35 +0200 Subject: [LangCodeExpander] Fix preferred audio/subtitle language mechanism. This also speeds up conversion to 3-char codes. --- xbmc/utils/LangCodeExpander.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- cgit v1.2.3 From b51ab27a9c289ebf504f45f48845ed09fef01b3d Mon Sep 17 00:00:00 2001 From: ace20022 Date: Fri, 27 Sep 2013 12:50:50 +0200 Subject: [LangInfo] Load preferred audio/subtitle setting during the startup. --- xbmc/Application.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index a10fc2c512..7e02896b74 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/"; -- cgit v1.2.3