https://github.com/szbartnik/ngx-translate-resx-http-loader
Use ResX files with ngx-translate Angular translation library
https://github.com/szbartnik/ngx-translate-resx-http-loader
angular angular2 i18n ngx-translate resx translation
Last synced: 10 days ago
JSON representation
Use ResX files with ngx-translate Angular translation library
- Host: GitHub
- URL: https://github.com/szbartnik/ngx-translate-resx-http-loader
- Owner: szbartnik
- License: mit
- Created: 2017-04-13T14:45:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-02T20:50:50.000Z (about 4 years ago)
- Last Synced: 2026-05-24T09:08:37.858Z (25 days ago)
- Topics: angular, angular2, i18n, ngx-translate, resx, translation
- Language: TypeScript
- Homepage:
- Size: 62.5 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NgX Translate ResX Http Loader [](https://travis-ci.org/kneefer/ngx-translate-resx-http-loader) [](https://www.npmjs.com/package/@kneefer/ngx-translate-resx-http-loader)
Load resx files for use with [ngx-translate](https://github.com/ngx-translate/core) Angular translation library.
Forked from [ngx-translate-po-http-loader](https://github.com/biesbjerg/ngx-translate-po-http-loader)
This library uses [ltx](https://github.com/node-xmpp/ltx) XML parser library in order to parse ResX files (XML-based).
To modify ResX files in friendly way I recommend [ResX Resource Manager](https://github.com/tom-englert/ResXResourceManager) GUI. Available both as standalone Windows application and Visual Studio extension.
## Installation
Using NPM
```
npm install @kneefer/ngx-translate-resx-http-loader
```
## Usage
```ts
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 { }
```
## Angular 9 and below
The newest (3.0.0) version is built for Angular 10 and ngx-translate 13. If you use Angular 9 or below please use following version:
```
@kneefer/ngx-translate-resx-http-loader@2.0.1
```
## RxJS 5 and below
If you can't use RxJS 6 (or at least 5.6.0-forward-compat.5) (RxJS introduces pipable operators in version 6) please use following version:
```
@kneefer/ngx-translate-resx-http-loader@1.0.0
```
## Old HttpModule
If you want to use deprecated HttpModule (Angular < 4.3.0) please use following version:
```
@kneefer/ngx-translate-resx-http-loader@0.3.5
```
## Development
#### Clone
```
git clone https://github.com/kneefer/ngx-translate-resx-http-loader.git
```
#### Install dependencies
```
npm install
```
#### Build
```
npm run build
```