Home

Awesome

<p align="center"> <a href="https://github.com/Celtian/ngx-translate-version" target="blank"><img src="assets/logo.svg?sanitize=true" alt="" width="120"></a> <h1 align="center">NgxTranslateVersion</h1> </p>

npm version Package License NPM Downloads Snyk stars forks HitCount

Angular module that provides version to your language files

Angular 19 compatible

Here's the demo

Install

  1. Use yarn (or npm) to install the package
yarn add ngx-translate-version
  1. 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`
     })
   ]
  })

Options

OptionTypeDefaultDescription
defaultLanguagestringenDefault language of your appliceation
versionstring0.0.0Version of your application
pathLocalesstringassets/locales.jsonPath to file with locales
pathI18n(lang: string) => string(lang) => assets/i18n/${lang}.jsonPath to faile with translations

Compatibility

Angularngx-translate-versionInstall
194.xyarn add ngx-translate-version
183.xyarn add ngx-translate-version@3
172.xyarn add ngx-translate-version@2
161.xyarn add ngx-translate-version@1
150.xyarn add ngx-translate-version@0

Peer Dependencies

  "@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"

License

Copyright © 2023 - 2024 Dominik Hladik

All contents are licensed under the MIT license.