-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove postMessage from form A, B, C and D
- Loading branch information
1 parent
d6d2c2b
commit 2d2ef66
Showing
16 changed files
with
203 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 25 additions & 13 deletions
38
small_claim_form/small_claim_form/form_b/src/app/layouts/main/main.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 14 additions & 17 deletions
31
small_claim_form/small_claim_form/form_b/src/app/shared/services/translate-config.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { Injectable } from "@angular/core"; | ||
import { TranslateService } from "@ngx-translate/core"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
providedIn: "root", | ||
}) | ||
export class TranslateConfigService { | ||
currentLang: any; | ||
|
||
constructor( | ||
private translate: TranslateService, | ||
) { | ||
this.currentLang = localStorage.getItem('lang'); | ||
constructor(private translate: TranslateService) { | ||
this.currentLang = localStorage.getItem("lang"); | ||
} | ||
|
||
getDefaultLanguage(){ | ||
if (this.currentLang) { | ||
this.translate.setDefaultLang(this.currentLang); | ||
} else { | ||
this.currentLang = 'en'; | ||
localStorage.setItem('lang', this.currentLang); | ||
this.translate.setDefaultLang(this.currentLang); | ||
setDefaultLanguage() { | ||
if (!this.currentLang || typeof this.currentLang !== "string") { | ||
this.currentLang = "en"; | ||
localStorage.setItem("lang", this.currentLang); | ||
} | ||
|
||
this.translate.setDefaultLang(this.currentLang); | ||
this.translate.use(this.currentLang); | ||
return this.currentLang; | ||
} | ||
|
||
setLanguage(setLang: string) { | ||
this.translate.use(setLang); | ||
localStorage.setItem('lang', setLang); | ||
localStorage.setItem("lang", setLang); | ||
} | ||
|
||
getCurrentLang() { | ||
return localStorage.getItem('lang'); | ||
return localStorage.getItem("lang"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 25 additions & 13 deletions
38
small_claim_form/small_claim_form/form_c/src/app/layouts/main/main.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 14 additions & 17 deletions
31
small_claim_form/small_claim_form/form_c/src/app/shared/services/translate-config.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { Injectable } from "@angular/core"; | ||
import { TranslateService } from "@ngx-translate/core"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
providedIn: "root", | ||
}) | ||
export class TranslateConfigService { | ||
currentLang: any; | ||
|
||
constructor( | ||
private translate: TranslateService, | ||
) { | ||
this.currentLang = localStorage.getItem('lang'); | ||
constructor(private translate: TranslateService) { | ||
this.currentLang = localStorage.getItem("lang"); | ||
} | ||
|
||
getDefaultLanguage(){ | ||
if (this.currentLang) { | ||
this.translate.setDefaultLang(this.currentLang); | ||
} else { | ||
this.currentLang = 'en'; | ||
localStorage.setItem('lang', this.currentLang); | ||
this.translate.setDefaultLang(this.currentLang); | ||
setDefaultLanguage() { | ||
if (!this.currentLang || typeof this.currentLang !== "string") { | ||
this.currentLang = "en"; | ||
localStorage.setItem("lang", this.currentLang); | ||
} | ||
|
||
this.translate.setDefaultLang(this.currentLang); | ||
this.translate.use(this.currentLang); | ||
return this.currentLang; | ||
} | ||
|
||
setLanguage(setLang: string) { | ||
this.translate.use(setLang); | ||
localStorage.setItem('lang', setLang); | ||
localStorage.setItem("lang", setLang); | ||
} | ||
|
||
getCurrentLang() { | ||
return localStorage.getItem('lang'); | ||
return localStorage.getItem("lang"); | ||
} | ||
|
||
} |
Oops, something went wrong.