aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2015-02-23 00:13:02 +0100
committermontellese <montellese@xbmc.org>2015-03-06 08:00:55 +0100
commit92d1728346258527e140e9d85dc894a33a5eccd0 (patch)
treebb5af6144372fb04eea3e00c919f70e609582007
parent66953bf328aef750876591793e7b55693bf29151 (diff)
addons: support the same locales used for the language addons in the <language> tag and in the "lang" attribute of <summary> and <description> tags in addon.xml
-rw-r--r--xbmc/addons/AddonManager.cpp2
-rw-r--r--xbmc/addons/GUIWindowAddonBrowser.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp
index 75d263442e..409364bfe2 100644
--- a/xbmc/addons/AddonManager.cpp
+++ b/xbmc/addons/AddonManager.cpp
@@ -719,7 +719,7 @@ std::string CAddonMgr::GetTranslatedString(const cp_cfg_element_t *root, const c
if (strcmp(tag, child.name) == 0)
{ // see if we have a "lang" attribute
const char *lang = m_cpluff->lookup_cfg_value((cp_cfg_element_t*)&child, "@lang");
- if (lang && 0 == strcmp(lang,g_langInfo.GetLanguageLocale().c_str()))
+ if (lang != NULL && g_langInfo.GetLocale().Matches(lang))
return child.value ? child.value : "";
if (!lang || 0 == strcmp(lang, "en"))
eng = &child;
diff --git a/xbmc/addons/GUIWindowAddonBrowser.cpp b/xbmc/addons/GUIWindowAddonBrowser.cpp
index 6a00fc7bfe..59a1dd8184 100644
--- a/xbmc/addons/GUIWindowAddonBrowser.cpp
+++ b/xbmc/addons/GUIWindowAddonBrowser.cpp
@@ -380,7 +380,8 @@ bool CGUIWindowAddonBrowser::GetDirectory(const std::string& strDirectory,
while (i < items.Size())
{
if (!FilterVar(true, items[i]->GetProperty("Addon.Language"), "en") ||
- !FilterVar(true, items[i]->GetProperty("Addon.Language"), g_langInfo.GetLanguageLocale()))
+ !FilterVar(true, items[i]->GetProperty("Addon.Language"), g_langInfo.GetLocale().GetLanguageCode()) ||
+ !FilterVar(true, items[i]->GetProperty("Addon.Language"), g_langInfo.GetLocale().ToShortString()))
{
i++;
}