diff options
Diffstat (limited to 'help3xsl/help2.js')
-rw-r--r-- | help3xsl/help2.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js index 0e7b9d3325..aed610371b 100644 --- a/help3xsl/help2.js +++ b/help3xsl/help2.js @@ -120,4 +120,21 @@ function getParameterByName(name, url) { } return decodeURIComponent(results[2].replace(/\+/g, " ")); } + +function existingLang(lang) { + if (lang === undefined) { + return 'en-US'; + } + + if (languagesSet.has(lang)) { + return lang; + } + + lang = lang.replace(/[-_].*/, ''); + if (languagesSet.has(lang)) { + return lang; + } + + return 'en-US'; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |