1.0.6 • Published 4 years ago

@andreasnicolaou/locale-translator v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

locale-translator

Translate any locale with the directive provided or the service

npm npm npm

Installation

1. Install via NPM:

npm i --save @andreasnicolaou/locale-translator

3. Import LocaleTranslationsModule into your app's root module

import { LocaleTranslationsModule } from '@andreasnicolaou/locale-translator';

@NgModule({
  ...
  imports: [
    LocaleTranslationsModule
  ],
  ...
})
export class AppModule { }

If you only want to use only the service just import

import { LocaleTranslationsService } from '@andreasnicolaou/locale-translator';

...

export class MyService {

  constructor(private locale: LocaleTranslationsService) {
    this.locale.updateLocale('en', { name: 'English', nativeName: 'Engish'})
    let locale: LangTrans  = this.locale.getLanguage('en');
    console.log(locale) // name,nativeName

  }

}

Example of pipe

Pipe will always return the locale name, if you want the native name just add translateLocale:true

    <a>{{'en' | translateLocale}}</a>

Contribution

  • Having an issue? or looking for support? Open an issue and we will get you the help you need.
  • Got a new feature or a bug fix? Fork the repo, make your changes, and submit a pull request.

Support this project

If you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you :smile:

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago