mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 09:23:16 +01:00
17 lines
322 B
TypeScript
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
|
|
}
|