tflori / angular-translator

translation module for angular
https://tflori.github.io/angular-translator/
MIT License
21 stars 6 forks source link

Change to one single configuration #10

Closed tflori closed 7 years ago

tflori commented 7 years ago

The only injectables we want to have are the TranslateService and the TranslateConfig. In the TranslateConfig we also have to configure the TranslateLoader. The goal is to make configuration easier and external:

The config:


import {TranslateConfig, TranslateLoaderJson} from 'angular2-translator';

export const translateConfig = new TranslateConfig({
  defaultLang: 'de',
  providedLangs: ['de', 'en'],
  loader: TranslateLoaderJson,
  loaderConfig: {
    path: 'i18n',
    extension: '-lang.json'
  },
  modules: {
    'admin': {}
  }
});