Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Framasoft
framacloud
Commits
a1c5fffd
Commit
a1c5fffd
authored
Jan 23, 2018
by
JosephK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
lang.js
lang.js
+11
-0
No files found.
.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
Markdown
is supported
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