mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2025-02-14 21:10:41 +01:00
* tweak number display * select whole amount upon input focus * handle letter input * number formatting
17 lines
322 B
TypeScript
17 lines
322 B
TypeScript
'use client'
|
|
|
|
import { useState, useEffect } 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
|
|
}
|