aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Montellese <sascha.montellese@gmail.com>2015-05-17 20:05:28 +0200
committerSascha Montellese <sascha.montellese@gmail.com>2015-05-17 20:05:28 +0200
commit4dd8255e1f14a777de53221e15702172b342bb3a (patch)
tree5d2d24401984032281df119caad0a44f443539fc
parentb87c729a8d4540bde6d2bdb3d7f38d169820730b (diff)
parent3d42583bcc8e0ea73998deaea90c5ce90efd0cc1 (diff)
Merge pull request #7152 from Montellese/fix_addon_language_fallback
addons: fix fallback language handling for metadata
-rw-r--r--xbmc/addons/AddonManager.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp
index 3f53ad567f..ba4bd7ee43 100644
--- a/xbmc/addons/AddonManager.cpp
+++ b/xbmc/addons/AddonManager.cpp
@@ -787,11 +787,10 @@ std::string CAddonMgr::GetTranslatedString(const cp_cfg_element_t *root, const c
{
// see if we have a "lang" attribute
const char *lang = m_cpluff->lookup_cfg_value((cp_cfg_element_t*)&child, "@lang");
- if (lang != NULL &&
- (g_langInfo.GetLocale().Matches(lang) || strcmp(lang, "en") == 0))
+ if (lang != NULL && g_langInfo.GetLocale().Matches(lang))
translatedValues.insert(std::make_pair(lang, child.value != NULL ? child.value : ""));
- else if (lang == NULL)
- translatedValues.insert(std::make_pair("en", child.value != NULL ? child.value : ""));
+ else if (lang == NULL || strcmp(lang, "en") == 0 || strcmp(lang, "en_GB") == 0)
+ translatedValues.insert(std::make_pair("en_GB", child.value != NULL ? child.value : ""));
}
}
@@ -803,7 +802,7 @@ std::string CAddonMgr::GetTranslatedString(const cp_cfg_element_t *root, const c
// find the language from the list that matches the current locale best
std::string matchingLanguage = g_langInfo.GetLocale().FindBestMatch(languages);
if (matchingLanguage.empty())
- matchingLanguage = "en";
+ matchingLanguage = "en_GB";
auto const& translatedValue = translatedValues.find(matchingLanguage);
if (translatedValue != translatedValues.end())