feat: add RUB and BRL currencies, make settings currency dropdown dynamic

This commit is contained in:
2026-02-08 10:30:00 +01:00
parent 3bf0ab3963
commit 0c9bef405f
2 changed files with 18 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import { t, i18n } from '../../i18n.js'
import { auth } from '../../services/auth.js'
import { favoritesService } from '../../services/favorites.js'
import { getCurrencySymbol, SUPPORTED_CURRENCIES } from '../../services/currency.js'
class PageSettings extends HTMLElement {
constructor() {
@@ -210,9 +211,11 @@ class PageSettings extends HTMLElement {
<div class="setting-item">
<label for="currency-select">${t('settings.currency')}</label>
<select id="currency-select">
<option value="USD" ${this.getCurrentCurrency() === 'USD' ? 'selected' : ''}>USD ($)</option>
<option value="EUR" ${this.getCurrentCurrency() === 'EUR' ? 'selected' : ''}>EUR (€)</option>
<option value="CHF" ${this.getCurrentCurrency() === 'CHF' ? 'selected' : ''}>CHF</option>
${SUPPORTED_CURRENCIES.filter(c => c !== 'XMR').map(c => {
const sym = getCurrencySymbol(c)
const label = sym !== c ? `${c} (${sym})` : c
return `<option value="${c}" ${this.getCurrentCurrency() === c ? 'selected' : ''}>${label}</option>`
}).join('')}
</select>
</div>
</section>