Returns a String with a BCP-47 language tag inside. If the locale couldn’t be obtained, null is returned instead.
BCP-47
null
import { locale } from '@tauri-apps/plugin-os';const locale = await locale();if (locale) { // use the locale string here} Copy
import { locale } from '@tauri-apps/plugin-os';const locale = await locale();if (locale) { // use the locale string here}
2.0.0
Returns a String with a
BCP-47
language tag inside. If the locale couldn’t be obtained,null
is returned instead.