Skip to content
This repository
Browse code

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 authored
2  xbmc/Application.cpp
@@ -763,6 +763,8 @@ bool CApplication::Create()
763 763
 
764 764
   CLog::Log(LOGINFO, "load language info file: %s", strLangInfoPath.c_str());
765 765
   g_langInfo.Load(strLangInfoPath);
  766
+  g_langInfo.SetAudioLanguage(CSettings::Get().GetString("locale.audiolanguage"));
  767
+  g_langInfo.SetSubtitleLanguage(CSettings::Get().GetString("locale.subtitlelanguage"));
766 768
 
767 769
   CStdString strLanguagePath = "special://xbmc/language/";
768 770
 
9  xbmc/utils/LangCodeExpander.cpp
@@ -213,6 +213,15 @@ bool CLangCodeExpander::ConvertToThreeCharCode(CStdString& strThreeCharCode, con
213 213
   }
214 214
   else if (strCharCode.size() > 3)
215 215
   {
  216
+    for(unsigned int i = 0; i < sizeof(g_iso639_2) / sizeof(LCENTRY); i++)
  217
+    {
  218
+      if (strCharCode.Equals(g_iso639_2[i].name))
  219
+      {
  220
+        CodeToString(g_iso639_2[i].code, strThreeCharCode);
  221
+        return true;
  222
+      }
  223
+    }
  224
+
216 225
     CStdString strLangInfoPath;
217 226
     strLangInfoPath.Format("special://xbmc/language/%s/langinfo.xml", strCharCode.c_str());
218 227
     CLangInfo langInfo;

0 notes on commit 494c67a

Please sign in to comment.
Something went wrong with that request. Please try again.