poe-i18n
Version:
i18n utility for Path of Exile
37 lines (29 loc) • 1.49 kB
Markdown
# poe-18n
[](https://travis-ci.org/eps1lon/poe-i18n)
[](https://coveralls.io/github/eps1lon/poe-i18n?branch=master)
[](https://badge.fury.io/js/poe-i18n)
[](https://david-dm.org/eps1lon/poe-i18n)
[](https://david-dm.org/eps1lon/poe-i18n?type=dev)
[](https://greenkeeper.io/)
i18n utility for Path of Exile@`3.3.0` with minimal dependencies.
## Install
```bash
$ npm install --save poe-i18n
```
## Usage
The package provides translations that are currently support by the game
client. Additional languages can be used but I'm not planning on maintaining languages that I can't parse from the game data.
```typescript
import { formatStats } from 'poe-i18n';
import stat_descriptions from 'poe-i18n/locale-data/en/stat_descriptions.json'
const merciless_translation: string[] = formatStats(
[{ id: 'physical_damage_+%', value: 150 }],
{ datas: { stat_descriptions } }
);
console.log(merciless_translation); // ['+150% increased Physical Damage']
```
## Documentation
- [API](docs/api.md)
- [changelog](CHANGELOG.md)
## License
MIT