Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3329 from ace20022/lang_fixes

[Fix] Fix preferred audio/subtitle language mechanism.
  • Loading branch information...
commit 494c67ae1fef4c31f613d724d3e3e67bdf2a4d90 2 parents e3a642f + b51ab27
Andreas Zelend ace20022 authored
Showing with 11 additions and 0 deletions.
  1. +2 −0  xbmc/Application.cpp
  2. +9 −0 xbmc/utils/LangCodeExpander.cpp
2  xbmc/Application.cpp
View
@@ -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/";
9 xbmc/utils/LangCodeExpander.cpp
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.