Skip to content
Snippets Groups Projects

Feature/internationalization

Merged Alice Poggioli requested to merge feature/internationalization into master
2 files
+ 21
1
Compare changes
  • Side-by-side
  • Inline
Files
2
www/index.html 0 → 100644
+ 25
0
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
</head>
<body>
<script>
//Language given in translation
const langs = ['fr', 'en'];
const defLang = 'en';
//Get the favorite language of the user's navigator
const userLangs = (navigator.languages || [navigator.language]).map(
a => a.split('-').shift(),
);
userLangs.push(defLang);
const selectedLang = userLangs.find(lang => langs.indexOf(lang) !== -1);
//Redirection to the appropriate index.html
document.location.replace(selectedLang);
</script>
</body>
</html>
Loading