Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
framacloud
Commits
a1c5fffd
Commit
a1c5fffd
authored
Jan 23, 2018
by
JosephK
Browse files
Redirection selon la langue
parent
074a5ac1
Pipeline
#36334
passed with stages
in 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
a1c5fffd
...
...
@@ -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
:
...
...
lang.js
0 → 100644
View file @
a1c5fffd
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment