This commit is contained in:
Your Name committed 2026-06-20 18:39:03 -04:00
1 parent 3c4bb06003
commit f7aa4d099f
36 files changed
+528 -180

No files matched your search

+8 -1
View File
@@ -1,6 +1,7 @@
"use client"
import Link from 'next/link'
import Link from './LocalizedLink'
import { getPathWithoutLocale, getPathWithLocale } from '../lib/locales'
import { useRouter, usePathname } from 'next/navigation'
import { useState, useEffect, useMemo, useRef } from 'react'
import type { Category } from '@homaroma/types'
@@ -89,7 +90,13 @@ export default function Navbar({ categories = [], initialMenu = [], settings = n
const changeLanguage = (code: string) => {
i18n.changeLanguage(code)
localStorage.setItem('homaroma_lang', code)
document.cookie = `homaroma_lang=${code}; path=/; max-age=31536000`
const currentPathWithoutLang = getPathWithoutLocale(pathname)
const newPath = getPathWithLocale(currentPathWithoutLang, code)
setLangSheetOpen(false)
router.push(newPath)
}
const loginWithLine = () => {