angular-gettext-loader

1.1.0 • Public • Published

angular-gettext-loader

Webpack loader for angular-gettext. Intended for compilation only. Use angular-gettext-cli together with npm scripts for extraction. For details see official developer guide for angular-gettext.

Parameters

format

Values: javascript, json. Default value: javascript

Compilation format, where javascript means Angular module.

module

Type: {string}, default value: gettext

Angular module name.

Usage

module.exports = {
  module: {
    loaders: [
      // Bundle as angular module 
      {
        test: /basic.*\.po$/,
        use: [{
          loader: 'angular-gettext-loader',
          options: {
            module: 'myApp'
          }
        }]
      },
      // Bundle as json, to be injected with gettextCatalog.setStrings()
      {
        test: /\.po$/,
        type: 'asset/source',
        use: [{
          loader: 'angular-gettext-loader',
          options: {
            format: 'json'
          }
        }]
      },
      // Copy as json, to be loaded with gettextCatalog.loadRemote()  
      {
        test: /additional.*\.po$/,
        type: 'asset/resource',
        generator: {
          filename: 'translations/[name].[hash].json'
        },
        use: [{
          loader: 'angular-gettext-loader',
          options: {
            format: 'json'
          }
        }]
      }
    ]
  }
}  

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    973
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    973
  • 1.0.1
    986
  • 1.0.0
    0

Package Sidebar

Install

npm i angular-gettext-loader

Weekly Downloads

1,959

Version

1.1.0

License

MIT

Unpacked Size

7.29 kB

Total Files

12

Last publish

Collaborators

  • princed