feat(HotelItem): update currency display logic and options

This commit is contained in:
Jan K9f 2024-09-17 08:23:33 +02:00
commit f575d73b3a
Signed by: jank
GPG key ID: B267751B8AE29EFE
2 changed files with 19 additions and 5 deletions

View file

@ -20,18 +20,32 @@ export class HotelItem {
console.log(this.selectedLanguage);
}
public getCurrencyCode(langCode: string | undefined): string {
if (!langCode) return '';
for (let language of this.langs) {
if (language.code === langCode) {
return language.currency;
}
}
return '';
}
public langs = [
{
"lang": "en",
"code": "en-US"
"code": "en-US",
"currency": "USD"
},
{
"lang": "cn",
"code": "cn-CN"
"code": "cn-CN",
"currency": "CNY"
},
{
"lang": "de",
"code": "de-DE"
"code": "de-DE",
"currency": "EUR"
}
];
}