Skip to content

Commit

Permalink
Navigator fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
alexristinmaa committed Dec 8, 2024
1 parent e18ac05 commit c7951e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions alexanderristinmaa/app/(root)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"use client";

import dynamic from 'next/dynamic';
import { isDictKey } from '../[lang]/dictionaries'

import { redirect } from 'next/navigation';

export default function Root() {
for(let language of navigator.languages) {
export default function Root() {
const nav = navigator || {languages: ["en"]};
for(let language of nav.languages) {
let lang = language.split("-")[0];

if(isDictKey(lang)) redirect(`${lang}`)
Expand Down

0 comments on commit c7951e2

Please sign in to comment.