diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-08-14 16:34:25 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-08-16 09:13:39 +0200 |
commit | 73023bcc0dba68f6677bc02cdad75145180e2b11 (patch) | |
tree | 66fa7eb6279cd0752e012e286c422b1162d96cea /help3xsl/help2.js | |
parent | 0d068dc8d5cd64f89c8a8e3d0a6bef6ed9e1ee87 (diff) |
Limit the online help only to the built languages.
Change-Id: Ib81dbd9a4047d9bb63761a43ef0b183a450b03f1
Reviewed-on: https://gerrit.libreoffice.org/59047
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
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: */ |