Angular module that provides version to your language files
✓ Angular 19 compatible
Here's the demo
- Use yarn (or npm) to install the package
yarn add ngx-translate-version
- Add
provideTranslateVersion
into your config
import { NgxAppVersionModule } from 'ngx-app-version';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideTranslateVersion(routes, {
defaultLanguage: 'en',
version: '1.0.0',
pathLocales: 'assets/locales.json',
pathI18n: (lang) => `assets/i18n/${lang}.json`
})
]
};
or module
import { NgxAppVersionModule } from 'ngx-app-version';
@NgModule({
// ...
providers: [
// ...
provideTranslateVersion(routes, {
defaultLanguage: 'en',
version: '1.0.0',
pathLocales: 'assets/locales.json',
pathI18n: (lang) => `assets/i18n/${lang}.json`
})
]
})
Option | Type | Default | Description |
---|---|---|---|
defaultLanguage | string | en |
Default language of your appliceation |
version | string | 0.0.0 |
Version of your application |
pathLocales | string | assets/locales.json |
Path to file with locales |
pathI18n | (lang: string) => string | (lang) => assets/i18n/${lang}.json |
Path to faile with translations |
Angular | ngx-translate-version | Install |
---|---|---|
19 | 4.x | yarn add ngx-translate-version |
18 | 3.x | yarn add ngx-translate-version@3 |
17 | 2.x | yarn add ngx-translate-version@2 |
16 | 1.x | yarn add ngx-translate-version@1 |
15 | 0.x | yarn add ngx-translate-version@0 |
"@angular/common": ">=18",
"@angular/core": ">=18",
"@gilsdav/ngx-translate-router-http-loader": ">=2",
"@gilsdav/ngx-translate-router": ">=7",
"@ngx-translate/core": ">=15",
"@ngx-translate/http-loader": ">=8"
Copyright © 2023 - 2024 Dominik Hladik
All contents are licensed under the MIT license.