zgo/src/app/language.service.ts

49 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-01-27 23:05:55 +00:00
import { Injectable } from '@angular/core';
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 {
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' ) {
return this.http.get<LanguageData>(this.baseURL +
2023-01-27 23:05:55 +00:00
'/?lang_id=' + encoding +
'&viewname=' + viewName);
}
}