Skip to content

Releases: ngx-translate/core

v2.1.0

09 May 17:12
Compare
Choose a tag to compare

<a name"2.1.0">

2.1.0 (2016-05-09)

Features

v2.0.0

27 Apr 15:21
Compare
Choose a tag to compare

<a name"2.0.0">

2.0.0 (2016-04-27)

Bug Fixes

  • npm: update angular 2 peer dependency (38ec3f1a)

Breaking Changes

  • the lib now only works with beta >=16 because of a change in pipe arguments
    (38ec3f1a)

v1.11.3

26 Apr 21:21
Compare
Choose a tag to compare

<a name"1.11.3">

1.11.3 (2016-04-26)

Bug Fixes

  • Parser: accept falsy values (3fb23352)

v1.11.2

26 Apr 13:26
Compare
Choose a tag to compare

<a name"1.11.2">

1.11.2 (2016-04-26)

Bug Fixes

v1.11.1

15 Apr 09:04
Compare
Choose a tag to compare

<a name"1.11.1">

1.11.1 (2016-04-15)

Bug Fixes

  • npm: Updated to beta 15 & removed most peer dependencies (60786305)

v1.11.0

29 Mar 21:09
Compare
Choose a tag to compare

<a name"1.11.0">

1.11.0 (2016-03-29)

Bug Fixes

  • TranslateParser: allow keys with dots along with subkeys (692dccc0, closes #56)
  • TranslateService:
    • removed deprecated RxJS fromArray (4b78732e, closes #76)
  • npm:
    • updated minimal version of angular 2 to beta 10 (b74dc347, closes #74)
    • update to angular2-beta.12 (0fdb2bea)

Features

  • TranslateService: allow user to reload lang (475a1a97, closes #65)

BREAKING CHANGES:

Because of recent changes we have to use RxJS >= beta 2 and that means a recent version of Angular 2. You now have to upgrade to Angular beta 10 or more to use ng2-translate.

v1.10.3

20 Mar 14:37
Compare
Choose a tag to compare

<a name"1.10.3">

1.10.3 (2016-03-20)

Bug Fixes

  • TranslateParser: allow keys with dots along with subkeys (82001278, closes #56)
  • TranslatePipe: more robust when keys are falsy (28eda375)
  • npm: update to angular2-beta.11 (13eea254)

v1.10.2

18 Mar 09:13
Compare
Choose a tag to compare

<a name"1.10.2">

1.10.2 (2016-03-18)

Bug Fixes

  • npm: support for angular2-beta.10 (1d55159f, closes #67)

v1.10.1

15 Mar 21:03
Compare
Choose a tag to compare

<a name"1.10.1">

1.10.1 (2016-03-15)

Bug Fixes

  • TranslatePipe: call markForChanges when the pipe updates a value (591ee4d5, closes #33)
  • parser: accept dots in json keys (7bcd6f5f, closes #53)

v1.10.0

06 Mar 17:11
Compare
Choose a tag to compare

<a name"1.10.0">

1.10.0 (2016-03-06)

Features

  • MissingTranslationHandler: the MissingTranslationHandler is now able to return a value or an o (23267b13)
  • TranslateService: onLangChange now returns a LangChangeEvent instead of an object (e3087ac7)

BREAKING CHANGES:

The methods setMissingTranslationHandler, useLoader and useStaticFilesLoader have been removed. It was not a good practice to change these after DI. You should use provide instead, during bootstrap or in the providers property of your component.

If you don't need to change anything to the default configuration just use TRANSLATE_PROVIDERS:

import {HTTP_PROVIDERS} from 'angular2/http';
import {TRANSLATE_PROVIDERS} from 'ng2-translate/ng2-translate';
import {bootstrap} from 'angular2/platform/browser';

bootstrap(AppComponent, [
    HTTP_PROVIDERS,
    TRANSLATE_PROVIDERS
]);

If you need extra customisation you should use provide:

import {provide} from 'angular2/core';
import {HTTP_PROVIDERS} from 'angular2/http';
import {TranslateLoader, TranslateStaticLoader, TranslateService} from 'ng2-translate/ng2-translate';
import {bootstrap} from 'angular2/platform/browser';

bootstrap(AppComponent, [
    HTTP_PROVIDERS,
    provide(TranslateLoader, {
        useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),
        deps: [Http]
    }),
    // use TranslateService here, and not TRANSLATE_PROVIDERS (which will define a default TranslateStaticLoader)
    TranslateService
]);

You can also use provide to define this at a component level, just add it to the providers property of your application.

If you use Ionic 2, you can customize the service like this:

import {provide} from 'angular2/core';
import {TranslateService, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';

@App({
  templateUrl: '....',
  config: {},
  providers: [
    provide(TranslateLoader, {
      useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),
      deps: [Http]
    }),
    TranslateService
  ]
});