Commit d1a7eb43 authored by  JosephK's avatar JosephK

Redirection selon la langue

parent 1f73ab31
Pipeline #36325 passed with stages
in 1 minute and 55 seconds
......@@ -10,6 +10,7 @@ pages:
- git fetch https://framagit.org/Framatophe/manueldumo.git
- git subtree pull --prefix fr/manueldumo https://framagit.org/Framatophe/manueldumo.git master --squash
- gitbook build
- sed -i -e 's/<body>/<body><script src="lang.js" type="text\/javascript"><\/script>/g' _book/index.html
- mv _book/ public/
artifacts:
paths:
......
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;
}
}
}
window.location.href = window.location.href + ((u$Lang('fr')) ? '/fr' : '/en')
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