# i18n-ts

> Type safe internationalization utility for TypeScript

Latest version **1.0.5** (published 2019-03-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-03-27 |
| First published | 2018-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Sparkbit |
| Maintainers | sparkbit |
| Keywords | i18n, TypeScript, internationalization |

## Links

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

## 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

- 1.0.5 (latest) — 2019-03-27
- 1.0.4 — 2019-03-11
- 1.0.3 — 2019-03-11
- 1.0.2 — 2018-02-23
- 1.0.1 — 2018-02-21
- 1.0.0 — 2018-02-21

## README

i18n-ts
=======

I18n-ts is a type safe internationalization utility for TypeScript. The i18n messages are defined as plain TypeScript objects:

 ```typescript

const en = {
    hello: "Hi!"
    greeting: (name: string) => `Hi ${name}`
};

const de = {
    hello: "Hallo!",
    greeting: (name: string) => `Hallo ${name}`
};
const i18n = {
    en: en,
    de: de,
    default: en
};

const messages = new I18nResolver(i18n, "de").translation;

// TypeScript will infere the precise type of messages
console.log(messages.hello);
 ```

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