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
|
|
|
---
|
|
|
|
|
2022-01-03 19:59:34 +00:00
|
|
|
<meta http-equiv="refresh" content="5;url=/en/getting-started">
|
2021-07-31 05:39:15 +00:00
|
|
|
<script>
|
2021-12-22 21:11:05 +00:00
|
|
|
// WIP: trigger a client-side redirect based on the browser language.
|
|
|
|
// A vercel.json redirect is enforced in production, so no user should ever see this page.
|
|
|
|
// Remove the vercel.json redirect when this is ready.
|
|
|
|
const KNOWN_LANGUAGES = [
|
|
|
|
'bg',
|
|
|
|
'de',
|
|
|
|
'en',
|
|
|
|
'es',
|
|
|
|
'fi',
|
|
|
|
'nl',
|
|
|
|
'pt-br',
|
|
|
|
'zh-CN',
|
|
|
|
'zh-TW',
|
|
|
|
'fr',
|
|
|
|
'kr',
|
|
|
|
'da',
|
|
|
|
'ja',
|
|
|
|
];
|
|
|
|
let newLangWithRegion = (
|
|
|
|
window.navigator.userLanguage ||
|
|
|
|
window.navigator.language ||
|
|
|
|
'en-US'
|
|
|
|
).substr(0, 5);
|
|
|
|
let newLang = newLangWithRegion.substr(0, 2);
|
2022-01-03 19:59:34 +00:00
|
|
|
if (KNOWN_LANGUAGES.includes(newLangWithRegion)) {
|
2021-12-22 21:11:05 +00:00
|
|
|
window.location.pathname = '/' + newLangWithRegion + '/getting-started';
|
|
|
|
} else if (KNOWN_LANGUAGES.includes(newLang)) {
|
|
|
|
window.location.pathname = '/' + newLang + '/getting-started';
|
|
|
|
} else {
|
2022-01-03 19:59:34 +00:00
|
|
|
window.location.pathname = '/en/getting-started';
|
2021-12-22 21:11:05 +00:00
|
|
|
}
|
2021-08-06 05:51:07 +00:00
|
|
|
</script>
|