<commit_before># c-3po
[![NPM](https://nodei.co/npm/c-3po.png?downloads=true)](https://nodei.co/npm/c-3po/)

# javascript i18n localization library based on es6 tagged templates

## Usage example
```js
import { t, ngettext, msgid } from 'c-3po'

// formatted strings
const name = 'Mike';
const helloMike = t`Hello ${name}`;

// plurals (works for en locale out of the box)
const n = 5;
const msg = ngettext(msgid`${ n } task left`, `${ n } tasks left`, n)
```

## Key features
* Can resolve translations at build or runtime.
* Uses es2015 (es6) template literals for formatting.
* Compatible with GNU gettext utility format (.po, .pot files).
* Intelligent translations extraction (xgettext alternative).
* Builtin validation for translated strings format.


## Installation

```bash
npm install --save c-3po
npm install --save-dev babel-plugin-c-3po
```
### Quick demo - https://jsfiddle.net/AlexMost/9wuafbL5/7/
### Docs - [https://c-3po.js.org](https://c-3po.js.org)

## Tutorials
* [Quick Start](https://c-3po.js.org/quick-start.html)<commit_msg>upd README<commit_after># c-3po
[![NPM](https://nodei.co/npm/c-3po.png?downloads=true)](https://nodei.co/npm/c-3po/)

# javascript i18n localization library based on es6 tagged templates

## Usage example
```js
import { t, ngettext, msgid } from 'c-3po'

// formatted strings
const name = 'Mike';
const helloMike = t`Hello ${name}`;

// plurals (works for en locale out of the box)
const n = 5;
const msg = ngettext(msgid`${ n } task left`, `${ n } tasks left`, n)
```

## Key features
* Can resolve translations at [build](https://c-3po.js.org/localization-with-webpack-and-c-3po.html#step-3-extracting-translations) or runtime.
* Uses es2015 (es6) template literals for formatting.
* Compatible with GNU gettext utility format (.po, .pot files).
* Intelligent translations extraction (xgettext alternative).
* Builtin validation for translated strings format.


## Installation

```bash
npm install --save c-3po
npm install --save-dev babel-plugin-c-3po
```
### Quick demo - https://jsfiddle.net/AlexMost/9wuafbL5/7/
### Docs - [https://c-3po.js.org](https://c-3po.js.org)

## Tutorials
* [Quick Start](https://c-3po.js.org/quick-start.html)
{'fraction_non_alphanumeric': 0.16279069767441862, 'fraction_numerical': 0.02051983584131327, 'mean_word_length': 4.138173302107728, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '694485', 'n_tokens_mistral': 823, 'n_tokens_neox': 749, 'n_words': 212}