0.0.6 • Published 7 years ago

@fcojunr/ngx-i18n v0.0.6

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

ngx-i18n

Based on the way iOS and Android work, this library was developed for i18n application in Angular applications in a practical and fast way.

Instalation

Get package on npm:

npm i @fcojunr/ngx-i18n --save

or yarn:

yarn add @fcojunr/ngx-i18n --save

Configuration

Configure in your app.modules.ts the component NgxI18nModule

import { NgxI18nModule } from  '@fcojunr/ngx-i18n';
...
imports: [
...
	NgxI18nModule.forRoot({
		directory: 'assets/i18n',
		defaultLocale: 'pt-BR',
		locale: navigator.language
	}),
...
PropertyDescription
directorySource here your json files
defaultLocaleWill be used case browser locale not found
localeCurrent locale

Configure path i18n

Create in your application a folder into assets with named i18n, and add json files for respective languages. The json files will be named conform ISO Language Code Table.

Usage

Add ngx-i18n attribute on tags that will have your text modified.

<p ngx-i18n="label_key">Lorem ipsum</p>

The content of tag will be replaced by value which was defined in the json language.

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago