Files
stack/packages/mosaic/framework/skills/vueuse-functions/references/useNavigatorLanguage.md
T
fargo 1a822493ba format: apply repo prettier (3.8.1) to the folded skills tree
963 markdown files reformatted with the repository's pinned prettier so
pnpm format:check covers the folded tree like every other repo file.

The formatter's embedded-language pass also normalized code fences
(TS semicolons, closed HTML tags in examples, lowercased CSS hex colors,
one renumbered list that skipped an index). Alphanumeric token deltas vs
the fold commit were audited file-by-file; all are formatter-equivalent
markup normalizations plus the four sanitized skills.
2026-08-19 14:37:17 -05:00

1.4 KiB

category
category
Sensors

useNavigatorLanguage

Reactive navigator.language.

Usage

import { useNavigatorLanguage } from '@vueuse/core';

const { language } = useNavigatorLanguage();

watch(language, () => {
  // Listen to the value changing
});

Type Declarations

export interface NavigatorLanguageState {
  isSupported: ComputedRef<boolean>;
  /**
   *
   * 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>;
}
/**
 *
 * 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?: ConfigurableWindow,
): Readonly<NavigatorLanguageState>;
export type UseNavigatorLanguageReturn = ReturnType<typeof useNavigatorLanguage>;