Use as any other Webpack plugin or, if you're using Webpacker, append the plugin in your environment configuration:
// config/webpack/[env].js
const { environment } = require('@rails/webpacker');
const RailsI18nWebpackPlugin = require('@18f/identity-rails-i18n-webpack-plugin');
environment.plugins.append('RailsI18nWebpackPlugin', new RailsI18nWebpackPlugin());
A Node.js util.format
-formatted string, given an object of strings for each processed chunk.
Optional, defaults to '(window._locale_data = window._locale_data || []).push(%j);'
.
The directory where locale YAML data is located. Defaults to config/locales
relative to the project root.
Optional, defaults to path.resolve(process.cwd(), 'config/locales')
.
The default locale for the application.
Optional, defaults to 'en'
.
Callback invoked when a key cannot be found in locale data, optionally returning a string to return in its place.
Optional, defaults to () => {}
.