2023-01-27 23:05:55 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
2023-01-29 00:09:18 +00:00
|
|
|
import { LanguageData } from './language.model';
|
2023-01-27 23:05:55 +00:00
|
|
|
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
|
|
|
|
|
|
import { ConfigData } from './configdata';
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root'
|
|
|
|
})
|
|
|
|
|
|
|
|
export class LanguageService {
|
|
|
|
|
2023-01-29 00:09:18 +00:00
|
|
|
private baseURL = 'http://localhost:8080/getlang';
|
2023-01-27 23:05:55 +00:00
|
|
|
|
|
|
|
constructor(private http:HttpClient) {
|
|
|
|
}
|
|
|
|
|
|
|
|
httpOptions = {
|
|
|
|
headers: new HttpHeaders({
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
_getViewElements ( viewName:string,
|
|
|
|
encoding:string = 'en-US' ){
|
|
|
|
|
|
|
|
|
|
|
|
const vElem : string = '{' +
|
|
|
|
'"login_confirm_login":"ZGo confirma su ingreso en la cadena de Zcash"' + ',' +
|
|
|
|
'"login_connect_to_zgo":"Conectar su billetera a ZGo"' + ',' +
|
|
|
|
'"login_enter_pin":"Ingrese el PIN enviado por ZGo para confirmar su billetera:"' + ',' +
|
|
|
|
'"login_last_block":"Ultimo Bloque Verificado: "' + ',' +
|
|
|
|
'"login_link_wallet":"Asociar Billetera"' + '}';
|
|
|
|
|
|
|
|
return vElem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getViewElements ( viewName:string,
|
|
|
|
encoding:string = 'en-US' ) {
|
|
|
|
|
2023-01-29 00:09:18 +00:00
|
|
|
return this.http.get<LanguageData>(this.baseURL +
|
2023-01-27 23:05:55 +00:00
|
|
|
'/?lang_id=' + encoding +
|
|
|
|
'&viewname=' + viewName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|