# @mapbox-controls/language

> Change map language

Latest version **5.0.0** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mapbox-controls/language
pnpm add @mapbox-controls/language
yarn add @mapbox-controls/language
bun add @mapbox-controls/language
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-09-30 |
| First published | 2023-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Maintainers | korywka |

## Links

- npm: https://www.npmjs.com/package/@mapbox-controls/language
- Repository: korywka/mapbox-controls
- npm.io page: https://npm.io/package/@mapbox-controls/language

## Dependencies (1)

- [@mapbox-controls/helpers](https://npm.io/package/@mapbox-controls/helpers.md) 5.0.0

## Recent versions

- 5.0.0 (latest) — 2026-09-30
- 4.1.0 — 2026-06-28
- 4.0.0 — 2026-06-28
- 3.0.0 — 2024-08-29
- 2.1.0 — 2024-06-25
- 2.0.0 — 2024-06-02
- 1.2.0 — 2024-04-19
- 1.1.0 — 2023-12-21
- 1.0.1 — 2023-10-04
- 1.0.0 — 2023-10-03

## README

[<< all controls](/README.md)

# 📖 @mapbox-controls/language

![](https://github.com/korywka/mapbox-controls/assets/988471/b2984a79-73f0-43e2-96b3-782b4b9970dc)

Localize map or change dynamically language.

By default, supported languages option is [the supported list](https://docs.mapbox.com/data/tilesets/reference/mapbox-streets-v8/#common-fields) by mapbox styles.

```
npm i @mapbox-controls/language
```

```js
// set language from browser, use 'mul' as fallback
map.addControl(new LanguageControl());

// set custom language while initialization
const languageControl = new LanguageControl({
	language: 'ru',
});
map.addControl(languageControl);

// or change language dynamically
languageControl.setLanguage(event.target.value);
```

## Options

```ts
export type ControlOptions = {
	supportedLanguages?: string[];
	language?: string;
	getLanguageKey?: (language: string) => string;
	excludedLayerIds?: string[];
};
```

## Methods

- `setLanguage(lang?: string | undefined): void;` - set dynamically map language

---
_Source: https://npm.io/package/@mapbox-controls/language · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
