diff --git a/static/skin/index.js b/static/skin/index.js index eb1388997..b6504dd18 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -114,12 +114,18 @@ ${downloadLink ? `
Download ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}
`: ''}` : ''}
${description}
-
${language.substr(0, 2).toUpperCase()}
+
${getLanguageCodeToDisplay(language)}
${tagHtml}
`; return divTag; } + function getLanguageCodeToDisplay(langCode3Letter) { + const langCode2Letter = (Object.keys(iso6391To3).find(key => iso6391To3[key] === langCode3Letter)); + const res = (langCode2Letter != undefined) ? langCode2Letter : langCode3Letter; + return res.toUpperCase(); + } + function toggleFooter(show=false) { if (show) { footer.style.display = 'block';