Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/princed/angular-gettext-loader
Webpack loader for angular-gettext
https://github.com/princed/angular-gettext-loader
angular gettext webpack webpack-loader
Last synced: about 1 month ago
JSON representation
Webpack loader for angular-gettext
- Host: GitHub
- URL: https://github.com/princed/angular-gettext-loader
- Owner: princed
- License: mit
- Created: 2015-07-15T22:03:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T01:29:10.000Z (about 3 years ago)
- Last Synced: 2024-10-08T05:30:53.958Z (about 1 month ago)
- Topics: angular, gettext, webpack, webpack-loader
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [angular-gettext](https://github.com/rubenv/angular-gettext)-loader
Webpack loader for angular-gettext. Intended for compilation only.
Use [angular-gettext-cli](https://github.com/huston007/angular-gettext-cli) together with [npm scripts](https://docs.npmjs.com/misc/scripts) for extraction.
For details see official [developer guide](https://angular-gettext.rocketeer.be/dev-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
```js
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'
}
}]
}
]
}
}
```