# svelte-i18n

> Internationalization library for Svelte

Latest version **4.0.1** (published 2024-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install svelte-i18n
pnpm add svelte-i18n
yarn add svelte-i18n
bun add svelte-i18n
```

Provides the command `svelte-i18n`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2024-10-21 |
| First published | 2018-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16 |
| Dependencies | 7 |
| Unpacked size | 56.2 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1380 |
| Author | Christian Kaisermann |
| Maintainers | kaisermann |
| Keywords | svelte, i18n, internationalization, localization, translation |

## Links

- npm: https://www.npmjs.com/package/svelte-i18n
- Repository: https://github.com/kaisermann/svelte-i18n
- Homepage: https://github.com/kaisermann/svelte-i18n#readme
- Issues: https://github.com/kaisermann/svelte-i18n/issues
- npm.io page: https://npm.io/package/svelte-i18n

## Dependencies (7)

- [sade](https://npm.io/package/sade.md) ^1.8.1
- [esbuild](https://npm.io/package/esbuild.md) ^0.19.2
- [cli-color](https://npm.io/package/cli-color.md) ^2.0.3
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [tiny-glob](https://npm.io/package/tiny-glob.md) ^0.2.9
- [estree-walker](https://npm.io/package/estree-walker.md) ^2
- [intl-messageformat](https://npm.io/package/intl-messageformat.md) ^10.5.3

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2024-10-21
- 4.0.0-alpha.1 (alpha) — 2023-10-14
- 3.5.0-alpha.0 (next) — 2022-11-19
- 4.0.0 — 2023-10-16
- 3.7.5-alpha.1 — 2023-10-14
- 3.7.4 — 2023-09-04
- 3.7.3 — 2023-09-03
- 3.7.3-0 — 2023-09-03
- 3.7.2 — 2023-09-03
- 3.7.1 — 2023-09-03
- 3.7.0 — 2023-07-04
- 3.6.0 — 2022-11-25
- 3.5.2 — 2022-11-23
- 3.5.1 — 2022-11-22
- 3.5.0 — 2022-11-22
- … 65 more at https://npm.io/package/svelte-i18n/versions

## README

> :information_source: `svelte-i18n` is due to some reworking, like moving from a singleton to instances. This will be worked on when I find the time and priority :pray:

[![npm version](https://badge.fury.io/js/svelte-i18n.svg)](https://badge.fury.io/js/svelte-i18n) ![](https://github.com/kaisermann/svelte-i18n/workflows/CI/badge.svg)

# svelte-i18n

> Internationalization for Svelte.

`svelte-i18n` helps you localize your app using the reactive tools Svelte provides. By using [stores](https://svelte.dev/docs#svelte_store) to keep track of the current `locale`, `dictionary` of messages and to `format` messages, we keep everything neat, in sync and easy to use on your svelte files.

**Requirements**

- Node: `>= 11.15.0`
- Browsers: `Chrome 38+`, `Edge 16+`, `Firefox 13+`, `Opera 25+`, `Safari 8+`.

```svelte
<script>
  import { _ } from 'svelte-i18n'
</script>

<h1>{$_('page.home.title')}</h1>

<nav>
  <a>{$_('page.home.nav', { default: 'Home' })}</a>
  <a>{$_('page.about.nav', { default: 'About' })}</a>
  <a>{$_('page.contact.nav', { default: 'Contact' })}</a>
</nav>
```

```jsonc
// en.json
{
  "page": {
    "home": {
      "title": "Homepage",
      "nav": "Home"
    },
    "about": {
      "title": "About",
      "nav": "About"
    },
    "contact": {
      "title": "Contact",
      "nav": "Contact Us"
    }
  }
}
```

- [Documentation / Getting Started](/docs/Getting%20Started.md)
- [Usage with Svelte Kit](/docs/Svelte-Kit.md)
- [i18n VSCode extension (3rd party)](https://github.com/antfu/i18n-ally)

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