Skip to content

Celtian/ngx-translate-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NgxTranslateVersion

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

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

Compatibility

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

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.