JSPM

ngx-i18n-combine

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 443
  • Score
    100M100P100Q98866F
  • License MIT

Merge i18n files from components and merge to common locale files

Package Exports

  • ngx-i18n-combine
  • ngx-i18n-combine/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-i18n-combine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ngx-i18n-combine

Combine i18n locale files from components i18n directory to assets. For example one-component/i18n/[lang].json and two-component/i18n/[lang].json to assets/i18/[lang].json

Install

npm install --save ngx-i18n-combine

Usage

Add an combine script to your project's package.json:

"scripts": {
  "combine": "ngx-i18n-combine -i ./src/i18n/ -o ./src/assets/i18n/"
}

or

You can now run npm run combine to combine files.

Examples

Combine from multiple dirs

ngx-i18n-combine -i ./src/**/i18n -o ./src/assets/i18n/i18n.json

Combine from multiple dirs

ngx-i18n-combine -i ./src/component-1/i18n ./src/component-2/i18n -o ./src/assets/i18n

Combine and save to multiple files

ngx-i18n-combine -i ./src -o ./src/assets/i18n

or

ngx-i18n-combine -i ./src/**/i18n/*.json -o ./src/assets/i18n/{en,de}.json

or

ngx-i18n-combine -i ./src/component-1/i18n/en.json ./src/component-2/i18n/en.json -o ./src/assets/i18n/en.json

CLI

Usage:
ngx-i18n-combine [options]

Options:
--version, -v       Show version number 
                    [boolean]

--help, -h          Show help 
                    [boolean]

--input, -i         Paths you would like to extract files from. 
                    You can use path expansion, 
                    glob patterns and multiple paths 
                    [array] 
                    [default: current working path]

--output, -o        Paths where you would like to save merged files. 
                    You can use path expansion, 
                    glob patterns and multiple paths 
                    [array] 
                    [required]
                    
--indent, -it       Output format indentation
                    [string]
                    [default: "\t"]

--sort, -s          Sort strings in alphabetical order when saving 
                    [boolean] 
                    [default: false]

--minify, -m        Minify strings in output files 
                    [boolean] 
                    [default: false]

--verbose, -vb      If true, prints all processed file paths to console 
                    [boolean] 
                    [default: true]
                    
--watch, -w         Watch changes
                    [boolean] 
                    [default: false]