Commit a1c5fffd authored by  JosephK's avatar JosephK

Redirection selon la langue

parent 074a5ac1
Pipeline #36334 passed with stages
in 45 seconds
......@@ -7,6 +7,7 @@ pages:
- git config user.name "Nobody"
- git config user.email "nobody@framasoft.org"
- gitbook build
- sed -i -e 's/<body>/<body><script src="lang.js" type="text\/javascript"><\/script>/g' _book/index.html
- /bin/bash ./redirections.sh
- mv _book/ public/
artifacts:
......
function u$Lang(lg) {
var userLang = navigator.languages || [root.navigator.language || root.navigator.userLanguage];
for (var i = 0; i < userLang.length; i++) {
if(userLang[i].substring(0,2).toLowerCase() == lg) {
return true;
}
}
}
var lg = window.location.href + ((u$Lang('fr')) ? 'fr' : 'en');
window.location.href = lg
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment