-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
39 lines (25 loc) · 886 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: NavigatorLanguage.language
slug: Web/API/Navigator/language
---
{{APIRef("HTML DOM")}}
La propiedad de solo lectura **`Navigator.language`** devuelve un string representando el lenguaje predefinido del usuario, generalmente es el lenguaje configurado para la interfaz del navegador.
## Sintaxis
```
lang = globalObj.navigator.language
```
### Valores
`Un string que representa el código del lenguaje standard como se define en la` [BCP 47](http://www.ietf.org/rfc/bcp/bcp47.txt). Ejemplos de códigos válidos de lenguaje incluyen: "en", "en-US", "fr", "es-ES", etc.
## Ejemplo
```js
if (window.navigator.language != "en") {
doLangSelect(window.navigator.language);
}
```
## Especificaciones
{{Specifications}}
## Compatibilidad de Navegadores
{{Compat}}
## Ver también
- {{domxref("Navigator.languages", "navigator.languages")}}
- {{domxref("navigator")}}