Files
fuel-price/.agents/skills/vueuse-functions/references/useNavigatorLanguage.md
Ovidiu U 4a3ce4cc1d
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
docs: add advanced skills for Vitest, Pinia, and Vue built-ins
Add comprehensive reference documentation for:
- Vitest: environments, projects/workspaces, type testing, vi utilities
- Pinia: HMR, Nuxt integration, SSR setup
- Vue: built-in components (Transition, Teleport, Suspense, KeepAlive) and advanced directives
2026-04-11 16:28:36 +01:00

58 lines
1.5 KiB
Markdown

---
category: Sensors
---
# useNavigatorLanguage
Reactive [navigator.language](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language).
## Usage
```ts
import { useNavigatorLanguage } from '@vueuse/core'
const { language } = useNavigatorLanguage()
watch(language, () => {
// Listen to the value changing
})
```
## Type Declarations
```ts
export interface NavigatorLanguageState extends Supportable {
/**
*
* ISO 639-1 standard Language Code
*
* @info The detected user agent language preference as a language tag
* (which is sometimes referred to as a "locale identifier").
* This consists of a 2-3 letter base language tag that indicates a
* language, optionally followed by additional subtags separated by
* '-'. The most common extra information is the country or region
* variant (like 'en-US' or 'fr-CA').
*
*
* @see https://www.iso.org/iso-639-language-codes.html
* @see https://www.loc.gov/standards/iso639-2/php/code_list.php
*
*/
language: ShallowRef<string | undefined>
}
export interface UseNavigatorLanguageOptions extends ConfigurableWindow {}
export type UseNavigatorLanguageReturn = Readonly<NavigatorLanguageState>
/**
*
* Reactive useNavigatorLanguage
*
* Detects the currently selected user language and returns a reactive language
* @see https://vueuse.org/useNavigatorLanguage
*
* @__NO_SIDE_EFFECTS__
*/
export declare function useNavigatorLanguage(
options?: UseNavigatorLanguageOptions,
): UseNavigatorLanguageReturn
```