remove console.log

This commit is contained in:
Gauthier Roebroeck 2025-08-08 16:19:28 +08:00
parent 19ce6c8a10
commit 0abc20fc1c

View file

@ -48,14 +48,10 @@ export const availableLocales = loadAvailableLocales()
*/ */
export function getLocale(): string { export function getLocale(): string {
const storageLocale = localStorage.getItem(USER_LOCALE_KEY) const storageLocale = localStorage.getItem(USER_LOCALE_KEY)
console.log('locale from storage:', storageLocale)
if (storageLocale && storageLocale in availableLocales) return storageLocale if (storageLocale && storageLocale in availableLocales) return storageLocale
// get the browser's preferred languages and see if we can match it to an available locale // get the browser's preferred languages and see if we can match it to an available locale
console.log('preferred languages:', navigator.languages) return match(navigator.languages, Object.keys(availableLocales), fallbackLocale)
const s = match(navigator.languages, Object.keys(availableLocales), fallbackLocale)
console.log('match:', s)
return s
} }
export const currentLocale = getLocale() export const currentLocale = getLocale()