From ef56200ef094062a5876e94e36d7fb18d8513062 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Mon, 17 Jul 2017 13:12:06 +0200 Subject: [PATCH] fix(TranslateService): don't change lang if it's already selected --- src/translate.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/translate.service.ts b/src/translate.service.ts index f9b6f4d5..6808ef61 100644 --- a/src/translate.service.ts +++ b/src/translate.service.ts @@ -205,6 +205,11 @@ export class TranslateService { * @returns {Observable<*>} */ public use(lang: string): Observable { + // don't change the language if the language given is already selected + if(lang === this.currentLang) { + return Observable.of(this.translations[lang]); + } + let pending: Observable = this.retrieveTranslations(lang); if(typeof pending !== "undefined") {