diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f27776d0..ebbda1c0f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Our versioning strategy is as follows: * `[angular]` Fix app build errors. Webpack version is locked at 5.78 due to https://github.com/webpack/webpack/issues/16981 ([#1448](https://github.com/Sitecore/jss/pull/1448)) * `[sitecore-jss-nextjs]` Fix middleware redirect when the target use regexp with querystring ([#1449](https://github.com/Sitecore/jss/pull/1449)) ([#1460](https://github.com/Sitecore/jss/pull/1460)) * `[templates/nextjs]` Fix incorrectly named .gitignore file `\scripts\temp\.npmignore` ([#1463](https://github.com/Sitecore/jss/pull/1463)) +* `[angular]` Avoid sending two dictionary service calls when switching language and refreshing the page ([#1473](https://github.com/Sitecore/jss/pull/1473)) ## 21.1.1 diff --git a/packages/create-sitecore-jss/src/templates/angular/src/app/app.component.ts b/packages/create-sitecore-jss/src/templates/angular/src/app/app.component.ts index 3c4660c62b..910b5a2ac8 100644 --- a/packages/create-sitecore-jss/src/templates/angular/src/app/app.component.ts +++ b/packages/create-sitecore-jss/src/templates/angular/src/app/app.component.ts @@ -1,7 +1,6 @@ import { Component, OnDestroy } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { JssContextService } from './jss-context.service'; -import { environment as env } from '../environments/environment'; import { Subscription } from 'rxjs'; @Component({ @@ -15,12 +14,6 @@ export class AppComponent implements OnDestroy { translate: TranslateService, jssContextService: JssContextService, ) { - // this language will be used as a fallback when a translation isn't found in the current language - translate.setDefaultLang(env.defaultLanguage); - - // the lang to use. if the lang isn't available, it will use the current loader to get them - translate.use(env.defaultLanguage); - this.contextSubscription = jssContextService.state.subscribe(jssState => { // listen for language changes if (jssState.language) {