Skip to content

Releases: ngx-translate/core

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
  ]
});

v1.9.0

06 Mar 08:37
Compare
Choose a tag to compare

<a name"1.9.0">

1.9.0 (2016-03-06)

Bug Fixes

  • TranslateParser: parser.flattenObject is called too often (f01ee793, closes #47)

Features

  • Translate: adding TRANSLATE_PROVIDERS for DI (5da101dd, closes #48, closes #46)

v1.8.0

28 Feb 21:15
Compare
Choose a tag to compare

<a name"1.8.0">

1.8.0 (2016-02-28)

Bug Fixes

  • TranslatePipe:
    • detect params changes to trigger pipe value update (dd43fa6e)
    • clean existing subscriptions to avoid memory leak (ccbb2daf)

Features

  • TranslateService:
    • you can now get instant translations with the instant method (b6c57d54, closes #20)
    • you can now define your own TranslateLoader with useLoader (3c4c491e, closes #39, #41)

v1.7.3

21 Feb 17:21
Compare
Choose a tag to compare

<a name"1.7.3">

1.7.3 (2016-02-21)

Bug Fixes

  • TranslateService: delete pending observable onComplete instead of onNext (f452c653, closes #39)
  • npm: update to angular2-beta.7, typescript 1.8 & other dependencies (e50da03c, closes #37, #38)

v1.7.2

16 Feb 23:13
Compare
Choose a tag to compare

<a name"1.7.2">

1.7.2 (2016-02-16)

Bug Fixes

  • tsc: include inline source code in sourcemaps (c3080d5c, closes #36)

v1.7.1

16 Feb 21:28
Compare
Choose a tag to compare

<a name"1.7.1">

1.7.1 (2016-02-16)

Bug Fixes

v1.7.0

11 Feb 22:08
Compare
Choose a tag to compare

<a name"1.7.0">

1.7.0 (2016-02-11)

Bug Fixes

  • ng-cli: revert don't ignore *.ts files anymore (d2315242)

Features

  • added handler feature for missing translations #23 (6b15197e)

v1.6.4

07 Feb 21:39
Compare
Choose a tag to compare

<a name"1.6.4">

1.6.4 (2016-02-07)

Bug Fixes

  • ng-cli: don't ignore *.ts files anymore (893cd751)

v1.6.3

07 Feb 20:37
Compare
Choose a tag to compare

<a name"1.6.3">

1.6.3 (2016-02-07)

Bug Fixes

  • ng-cli: don't ignore the bundle js file (a9867fdc)

v1.6.2

07 Feb 20:18
Compare
Choose a tag to compare

<a name"1.6.2">

1.6.2 (2016-02-07)

Bug Fixes

  • ng-cli: don't ignore the bundle folder for ng-cli (f7b128e6)