<commit_before>retranslate
===========
[![CircleCI](https://circleci.com/gh/Tankenstein/retranslate/tree/master.svg?style=shield)](https://circleci.com/gh/Tankenstein/retranslate/tree/master) [![Coverage Status](https://coveralls.io/repos/github/Tankenstein/retranslate/badge.svg)](https://coveralls.io/github/Tankenstein/retranslate)

Real simple translations for react. Lightweight (< 10 KB gzipped) and with no dependencies.

## Usage

First, install retranslate using
+ npm: `npm install --save retranslate`
+ or yarn: `yarn add retranslate`

```javascript
import { Message, Provider as TranslationProvider, withTranslations } from 'retranslate';

import SomeComponent from './someComponent';
import { getLanguage } from './config'; // some functionality to select a language, in this example, hopefully returning en or et.
import { version } from '../../package.json';

// You can import these from a json file that tools like crowdin can use, like
// import enTranslations from './translations.en.json';
// import etTranslations from './translations.et.json';
const translations = {
  en: {
    'main.heading': 'retranslate #{{ versionNumber }}',
    'main.subtitle': 'Real simple translations for react.',
    'current.language': 'Your current language is {{ currentLanguage }}',
    'bold.thing': 'This <b>thing</b> is bold',
  },
  et: {
    'main.heading': 'retranslate #{{ versionNumber }}',
    'main.subtitle': 'Väga lihtsad tõlked reactile.',
    'current.language': 'Teie hetke keel on {{ language }}',
    'bold.thing': 'See <b>asi</b> on tumedam',
  },
};

// You can use the withTranslations higher-order component to get a hold of the current language and the translate function.<commit_msg>Rename thing to text in readme<commit_after>retranslate
===========
[![CircleCI](https://circleci.com/gh/Tankenstein/retranslate/tree/master.svg?style=shield)](https://circleci.com/gh/Tankenstein/retranslate/tree/master) [![Coverage Status](https://coveralls.io/repos/github/Tankenstein/retranslate/badge.svg)](https://coveralls.io/github/Tankenstein/retranslate)

Real simple translations for react. Lightweight (< 10 KB gzipped) and with no dependencies.

## Usage

First, install retranslate using
+ npm: `npm install --save retranslate`
+ or yarn: `yarn add retranslate`

```javascript
import { Message, Provider as TranslationProvider, withTranslations } from 'retranslate';

import SomeComponent from './someComponent';
import { getLanguage } from './config'; // some functionality to select a language, in this example, hopefully returning en or et.
import { version } from '../../package.json';

// You can import these from a json file that tools like crowdin can use, like
// import enTranslations from './translations.en.json';
// import etTranslations from './translations.et.json';
const translations = {
  en: {
    'main.heading': 'retranslate #{{ versionNumber }}',
    'main.subtitle': 'Real simple translations for react.',
    'current.language': 'Your current language is {{ currentLanguage }}',
    'bold.thing': 'This <b>text</b> is bold',
  },
  et: {
    'main.heading': 'retranslate #{{ versionNumber }}',
    'main.subtitle': 'Väga lihtsad tõlked reactile.',
    'current.language': 'Teie hetke keel on {{ language }}',
    'bold.thing': 'See <b>tekst</b> on tumedam',
  },
};

// You can use the withTranslations higher-order component to get a hold of the current language and the translate function.
{'fraction_non_alphanumeric': 0.14543339150668994, 'fraction_numerical': 0.0011634671320535194, 'mean_word_length': 4.511217948717949, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2692793', 'n_tokens_mistral': 1036, 'n_tokens_neox': 995, 'n_words': 308}