# fronto-localize

> Localization module for react apps

Latest version **1.0.2** (published 2018-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install fronto-localize
pnpm add fronto-localize
yarn add fronto-localize
bun add fronto-localize
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-08-22 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Zack Siri |
| Maintainers | zacksiri |
| Keywords | localization, locales, i18n, fronto |

## Links

- npm: https://www.npmjs.com/package/fronto-localize
- Repository: https://github.com/frontojs/fronto-localize
- Homepage: https://github.com/frontojs/fronto-localize#readme
- Issues: https://github.com/frontojs/fronto-localize/issues
- npm.io page: https://npm.io/package/fronto-localize

## 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.2 (latest) — 2018-08-22
- 1.0.1 — 2018-08-22
- 1.0.0 — 2017-06-07

## README

# Fronto Localize

Basic Localization utility

``` js
// /path/to/component_name/locale.js
import localize from 'fronto-localize';

const en = {
  blah: "Blah"
};

const th = {
  blah: "บลา"
}

export default localize({ en, th });

```

Then in your component file.

``` js
// /path/to/component_name/index.js
import t from './locale'

class ComponentName extends React.PureComponent { 
  // ...
  render() {
    <div>{t('blah')}</div>
  }
}
```

By default it will look for the `localStorage.getItem('locale')` if that doesn't exist it defaults to `en`, however you can specify one like so `t('blah', 'th')`

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