Skip to content

KwintenP/ngx-translate-resx-http-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NgX Translate ResX Http Loader Build Status npm version

Load resx files for use with ngx-translate Angular translation library.
Forked from ngx-translate-po-http-loader

This library uses ltx XML parser library in order to parse ResX files (XML-based).

To modify ResX files in friendly way I recommend ResX Resource Manager GUI. Available both as standalone Windows application and Visual Studio extension.

Installation

Using NPM

npm install @kneefer/ngx-translate-resx-http-loader

Usage

import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateResxHttpLoader } from '@kneefer/ngx-translate-resx-http-loader';

export function createTranslateLoader(http: HttpClient) {
  // Only first constructor parameter is required
  return new TranslateResxHttpLoader(http, 'trans.', 'assets/i18n', '.resx');
}

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

Old HttpModule

If you want to use deprecated HttpModule (Angular < 4.3.0) please use following version:

Development

Clone

git clone https://github.com/kneefer/ngx-translate-resx-http-loader.git

Install dependencies

npm install

Build

npm run build

About

Use ResX files with ngx-translate Angular translation library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%