1.0.5 • Published 3 years ago

translations-conventions-loader v1.0.5

Weekly downloads
Last release
3 years ago

Transaltion convention loader

Simple webpack loader to help reduce boilerplate code by introducing conventions

Code Example

idea is based on AngularClass component convention loader.

if your translation file is named the same as your component file you dont have to specify this path in @Translations attribute: home.component.ts home.component.i18n.json

then inside you home.component.ts file you can simply type:

export class HomeComponent{

which is gonna be automatically by convention converted into:

    remote: './home.component.i18n.json',
    static: { 'en': require('./home.component.i18n.json')
    } })

to achieve that you need to register webpack loader for ts files:

          test: /\.ts$/,
          use: [
          exclude: [/\.(spec|e2e)\.ts$/]

remote - is option to say if we wanna have possiblity to use files from local for dev purposes instead of publishing everytime we make change