<commit_before># I.js
Tiny and simple utility to implement localization in JavaScript, supporting only scoped translations; and simple
compilation of templates.

## Objectives of the plugin
* Support scoped translations
* Allow the implementation of simple localization

## More complex solutions
I.js is meant to be as simple and short as possible, and to support only scoped translations.
Users who need more complex solutions (e.g. with support for pluralization), should look instead at other libraries:
* [i18n-js](https://github.com/fnando/i18n-js)
* [i18next](http://i18next.com/)

## Examples
The following example shows how to work with scoped translations, using I.js:
```js
(function () {

  //set the locale information:
  I.regional = {
    "en": {
      "voc": {
        "Hi": "Hi"
      }
    },
    "it": {
      "voc": {
        "Hi": "Ciao"
      }
    },
    "pl": {
      "voc": {
        "Hi": "Cześć"
      }
    }
  };

  I.setLocale("en");
  I.t("voc.Hi"); // --> "Hi"

  I.setLocale("it");
  I.t("voc.Hi"); // --> "Ciao"

  I.setLocale("pl");
  I.t("voc.Hi"); // --> "Cześć"

})();
```

The following example shows how to use simple templates:
```js
(function () {

  //set the locale information:
  I.regional = {
    "en": {
      "voc": {
        "HelloName": "Hello, {{name}}!"
      }
    },
    "it": {
       "voc": {
         "HelloName": "Ciao, {{name}}!"
       }
    }
  };

  I.setLocale("en");
  I.t("voc.HiName"); // --> "Hello, {{name}}!"
  I.t("voc.HiName", {
    name: "Edyta" // e.g. user.name
  }); // --> "Hello, Edyta!"

  I.setLocale("it");
  I.t("voc.HiName"); // --> "Ciao, {{name}}!"
  I.t("voc.HiName", {
    name: "Edyta" // e.g. user.name
  }); // --> "Ciao, Edyta!"

})();
```

## Notes
When setting a locale using the function setLocale; a class to the document.body is also added accordingly
(if the document object exists).<commit_msg>Updates README<commit_after># I.js
Tiny and simple utility to implement localization in JavaScript, supporting only scoped translations; and simple
compilation of templates.

## Objectives of the plugin
* Support scoped translations
* Allow the implementation of simple localization

## More complex solutions
I.js is meant to be as simple and short as possible, and to support only scoped translations.
Users who need more complex solutions (e.g. with support for pluralization), should look instead at other libraries:
* [i18n-js](https://github.com/fnando/i18n-js)
* [i18next](http://i18next.com/)

## Examples
The following example shows how to work with scoped translations, using I.js:
```js
(function () {

  //set the locale information:
  I.regional = {
    "en": {
      "voc": {
        "Hi": "Hi"
      }
    },
    "it": {
      "voc": {
        "Hi": "Ciao"
      }
    },
    "pl": {
      "voc": {
        "Hi": "Cześć"
      }
    }
  };

  I.setLocale("en");
  I.t("voc.Hi"); // --> "Hi"

  I.setLocale("it");
  I.t("voc.Hi"); // --> "Ciao"

  I.setLocale("pl");
  I.t("voc.Hi"); // --> "Cześć"

})();
```

The following example shows how to use simple templates:
```js
(function () {

  //set the locale information:
  I.regional = {
    "en": {
      "voc": {
        "HelloName": "Hello, {{name}}!"
      }
    },
    "it": {
       "voc": {
         "HelloName": "Ciao, {{name}}!"
       }
    }
  };

  I.setLocale("en");
  I.t("voc.HelloName"); // --> "Hello, {{name}}!"
  I.t("voc.HelloName", {
    name: "Edyta" // e.g. user.name
  }); // --> "Hello, Edyta!"

  I.setLocale("it");
  I.t("voc.HelloName"); // --> "Ciao, {{name}}!"
  I.t("voc.HelloName", {
    name: "Edyta" // e.g. user.name
  }); // --> "Ciao, Edyta!"

})();
```

## Notes
When setting a locale using the function setLocale; a class to the document.body is also added accordingly
(if the document object exists).
{'fraction_non_alphanumeric': 0.1901501185146168, 'fraction_numerical': 0.004213853041875165, 'mean_word_length': 2.556179775280899, 'pattern_counts': {'":': 30, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '2155854', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1323, 'n_words': 368}