This repository was archived by the owner on Mar 4, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const convert = require ( 'yaml-to-messageformat' )
2+ const loaderUtils = require ( 'loader-utils' )
3+ const MessageFormat = require ( 'messageformat' )
4+
5+ module . exports = function ( input ) {
6+ const options = loaderUtils . getOptions ( this )
7+ const { locales, translations } = convert ( input , options )
8+ const mf = new MessageFormat ( locales )
9+ if ( options . biDiSupport ) mf . setBiDiSupport ( )
10+ return mf . compile ( translations ) . toString ( 'module.exports' )
11+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " messageformat-yaml-loader" ,
3+ "version" : " 0.0.1" ,
4+ "description" : " Webpack loader for YAML files (e.g. Rails i18n)" ,
5+ "keywords" : [
6+ " messageformat" ,
7+ " yaml" ,
8+ " rails" ,
9+ " ruby" ,
10+ " i18n" ,
11+ " webpack"
12+ ],
13+ "main" : " index.js" ,
14+ "repository" : " https://github.com/eemeli/messageformat-yaml-loader" ,
15+ "author" : " Eemeli Aro <eemeli@gmail.com>" ,
16+ "license" : " MIT" ,
17+ "engines" : {
18+ "node" : " >=6.0"
19+ },
20+ "dependencies" : {
21+ "yaml-to-messageformat" : " ^0.1.0" ,
22+ "loader-utils" : " ^1.1.0" ,
23+ "messageformat" : " ^1.1.0"
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments