asi-calculator/features/prices/hooks/use-locale.ts
Matthias Kretschmann 51143f5980
migrate to biome (#28)
* migrate to biome

* get biome config from @kremalicious/config
2024-07-26 13:16:59 +01:00

17 lines
322 B
TypeScript

'use client'
import { useEffect, useState } from 'react'
export function useLocale() {
const [locale, setLocale] = useState('en-US')
useEffect(() => {
const userLocale = navigator?.languages?.length
? navigator.languages[0]
: navigator.language
setLocale(userLocale)
}, [])
return locale
}