@pluesenpai/ngx-translate-po-http-loader
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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 { }

Readme

Keywords

none

Package Sidebar

Install

npm i @pluesenpai/ngx-translate-po-http-loader

Weekly Downloads

0

Version

1.1.4

License

MIT

Unpacked Size

5.49 kB

Total Files

5

Last publish

Collaborators

  • pluesenpai