@biesbjerg/ngx-translate-po-http-loader

Load po files for use with ngx-translate

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
699Mar 19, 2021Dec 3, 2016Minified + gzip package size for @biesbjerg/ngx-translate-po-http-loader in KB

Readme

Description

Load po files for use with ngx-translate

Installation:

npm i @ngx-translate/core --save
npm i @biesbjerg/ngx-translate-po-http-loader --save

Usage:

import { HttpClient, HttpClientModule } from '@angular/common/http';

import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslatePoHttpLoader } from '@biesbjerg/ngx-translate-po-http-loader';

export function createTranslateLoader(http: HttpClient) {
    return new TranslatePoHttpLoader(http, 'assets/i18n', '.po');
}

@NgModule({
    imports: [
        BrowserModule,
        HttpClientModule,
        TranslateModule.forRoot({
            loader: {
                provide: TranslateLoader,
                useFactory: createTranslateLoader,
                deps: [HttpClient]
            }
        })
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.