Skip to content

Commit

Permalink
💥 fix: make correct usage of 'startsWith()'
Browse files Browse the repository at this point in the history
  • Loading branch information
retrozinndev authored Apr 3, 2024
1 parent 2d1c4db commit 0e60e29
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@
<body>
<script>
const browserLang = navigator.language;
switch(browserLang.startsWith) {
case "pt":
window.location.href="/br";
break;
default:
window.location.href="/en";
break;
}
if(browserLang.startsWith("pt")) {
window.navigator.href="/br";
} else {
window.location.href="/en";
}
</script>
<main>
<div class="container">
Expand Down

0 comments on commit 0e60e29

Please sign in to comment.