0.0.11 • Published 3 years ago

jal-translate v0.0.11

Weekly downloads
51
License
-
Repository
-
Last release
3 years ago

Installing Translate

The easiest way is to use the Angular CLI to automatically install Translate into your project

ng add jal-translate

Then it should be setup automatically

Manual Installation

If you are unable to use the automatic method above, follow these steps.

Install Translate packages through npm:

npm install jal-translate

Import the TranslateModule into your Angular application's module. Your application's main module might look like this:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TranslateModule } from 'jal-translate';
import { AppComponent } from './app.component';

@NgModule({
    imports: [
        BrowserModule,
        TranslateModule.forRoot({ configuration: { }})
        ....
     ],
     declarations: [ AppComponent ],
     bootstrap: [ AppComponent ]
})
export class AppModule {    }

Generate Translation files

You can use the ng generate command to create language files

ng generate jal-translate:language translations\en

The above command would generate the file translations\en.language.ts with some example boiler plate code for setting up your translations.

You would then need to add this language to the configuration in the module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { TranslateModule } from 'jal-translate';
import { LANG_EN_NAME } from './translations/en.language';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    TranslateModule.forRoot({ configuration: { en: LANG_EN_NAME }})
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago