2021-07-15 18:13:35 +00:00
|
|
|
---
|
2021-07-31 05:39:15 +00:00
|
|
|
import Layout from '../layouts/MainLayout.astro';
|
2021-07-15 18:13:35 +00:00
|
|
|
---
|
|
|
|
|
2021-07-31 05:39:15 +00:00
|
|
|
<script>
|
2021-08-02 06:38:50 +00:00
|
|
|
// Redirect the user, based on their browser language.
|
2021-07-31 06:11:24 +00:00
|
|
|
const KNOWN_LANGUAGES = ['en', 'nl', 'fi'];
|
2021-07-31 05:39:15 +00:00
|
|
|
let newLang = (window.navigator.userLanguage || window.navigator.language || 'en').substr(0, 2);
|
|
|
|
if (newLang === 'en') {
|
|
|
|
window.location.pathname = '/getting-started';
|
|
|
|
} else if (KNOWN_LANGUAGES.includes(newLang)) {
|
|
|
|
window.location.pathname = '/' + newLang + '/getting-started';
|
|
|
|
} else {
|
|
|
|
window.location.pathname = '/getting-started';
|
|
|
|
}
|
|
|
|
</script>
|