# text-localizer

> A lightweight, fast and flexible way to handle localized strings

Latest version **0.1.4** (published 2022-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install text-localizer
pnpm add text-localizer
yarn add text-localizer
bun add text-localizer
```

Provides the command `generate-l10n`.

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-02-05 |
| First published | 2021-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Enzo Manuel Mangano |
| Maintainers | enzomanuelmangano |
| Keywords | localization, l10n, i18n |

## Links

- npm: https://www.npmjs.com/package/text-localizer
- Repository: https://github.com/enzomanuelmangano/text-localizer
- Homepage: https://github.com/enzomanuelmangano/text-localizer#readme
- Issues: https://github.com/enzomanuelmangano/text-localizer/issues
- npm.io page: https://npm.io/package/text-localizer

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

- 0.1.4 (latest) — 2022-02-05
- 0.1.3 — 2021-10-21
- 0.1.2 — 2021-10-17
- 0.1.1 — 2021-10-14

## README

<h1 align="center">
📖 Text Localizer
</h1>

## Tutorial

[**Tutorial can be found here**](https://enzomanuelmangano.github.io/text-localizer/docs/basic-tutorial/js-ts/setup).

## Usage

```ts
import { TextLocalizer } from 'text-localizer';
import { fetchItTranslations } from './l10n/it';

(async () => {
  const localizer = new TextLocalizer({
    us: import('./l10n/us.json'),
    gb: import('./l10n/gb'),
    it: fetchItTranslations,
  });

  await localizer.setOptions({
    language: 'gb',
  });

  const translations = localizer.translations;

  console.log(translations.question); // "Which is your favourite cat?"

  console.log(
    localizer.formatTranslation(translations.help, { topic: 'Text Localizer' })
  );
})();
```

## Contributing

See the [contributing guide](https://github.com/enzomanuelmangano/text-localizer/blob/main/CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

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