2023-01-31 03:17:40 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { LanguageService } from './language.service';
|
|
|
|
|
2021-10-01 20:10:14 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
|
|
|
templateUrl: './app.component.html',
|
|
|
|
styleUrls: ['./app.component.css']
|
|
|
|
})
|
2022-07-22 04:06:23 +00:00
|
|
|
|
2021-10-01 20:10:14 +00:00
|
|
|
export class AppComponent {
|
2023-01-31 03:17:40 +00:00
|
|
|
|
|
|
|
title = 'ZGo';
|
|
|
|
|
|
|
|
zgoLanguage:string = '';
|
|
|
|
vE = {
|
|
|
|
mainPriceData : ''
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private languageService: LanguageService){
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit(){
|
2023-05-08 18:45:34 +00:00
|
|
|
//console.log('chgUILanguage() called on ngOnInit ');
|
2023-01-31 03:17:40 +00:00
|
|
|
this.chgUILanguage();
|
|
|
|
}
|
|
|
|
|
|
|
|
chgUILanguage() {
|
2023-05-08 18:45:34 +00:00
|
|
|
//console.log('MAIN.chgUILanguage Called ');
|
|
|
|
this.languageService.getViewElements('main').subscribe({
|
|
|
|
next: response => {
|
|
|
|
//console.log('response >> ', response );
|
|
|
|
//console.log('main_price_data -> ',response.data.main_price_data);
|
2023-01-31 03:17:40 +00:00
|
|
|
this.vE.mainPriceData = response.data.main_price_data;
|
|
|
|
this.zgoLanguage = response.language;
|
|
|
|
},
|
2023-05-08 18:45:34 +00:00
|
|
|
error: error => { console.log('Error --> ',error); }
|
|
|
|
});
|
2023-01-31 03:17:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
usFlagClicked() {
|
|
|
|
if ( this.zgoLanguage != 'en-US' ) {
|
|
|
|
localStorage.setItem('zgo_language','en-US');
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
esFlagClicked() {
|
|
|
|
if ( this.zgoLanguage != 'es-US' ) {
|
|
|
|
localStorage.setItem('zgo_language','es-US');
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 19:14:49 +00:00
|
|
|
|
2023-02-01 03:36:53 +00:00
|
|
|
brFlagClicked() {
|
|
|
|
if ( this.zgoLanguage != 'br-US' ) {
|
|
|
|
localStorage.setItem('zgo_language','br-US');
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-01 20:10:14 +00:00
|
|
|
}
|
2023-01-31 03:17:40 +00:00
|
|
|
|