<commit_before># rails-translations-webpack-plugin

Shares Rails i18n translations with your javascripts without duplicating contents

## Usage

- Install it `npm install rails-translations-webpack-plugin --save-dev`
- Require it in your `webpack.config.js`:

  ```js
  const RailsTranslationsPlugin = require("rails-translations-webpack-plugin");
  ```
- Add it to your plugins block. See below for options documentation:

  ```js
  plugins: [
    new RailsTranslationsPlugin({
      localesPath: path.resolve(__dirname, "../rails-app/config/locales"),
      root       : "src"
    })
  ]
  ```<commit_msg>specify to use json loader<commit_after># rails-translations-webpack-plugin

Shares Rails i18n translations with your javascripts without duplicating contents

## Usage

- Install it with `npm install rails-translations-webpack-plugin --save-dev`
- To access the generated translations remember to install also `json-loader` with `npm install json-loader --save-dev`
- Require it in your `webpack.config.js`:

  ```js
  const RailsTranslationsPlugin = require("rails-translations-webpack-plugin");
  ```
- Add it to your plugins block. See below for options documentation:

  ```js
  plugins: [
    new RailsTranslationsPlugin({
      localesPath: path.resolve(__dirname, "../rails-app/config/locales"),
      root       : "src"
    })
  ]
  ```
- Add JSON loader in your loaders block:

  ```js
  module: {
    loaders: [
      {
        include : "src",
        test    : /\.json$/,
        loader  : 'json-loader'
      }
    ]
  }
  ```
{'fraction_non_alphanumeric': 0.1195862960568843, 'fraction_numerical': 0.002585649644473174, 'mean_word_length': 3.1390374331550803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7260779', 'n_tokens_mistral': 485, 'n_tokens_neox': 444, 'n_words': 132}