feat: localize currency drop-down options

Enhanced the currency drop-down to display localized names if available. This improves user experience by showing familiar names in their local language. Ensures the default language is used if localization isn't specified.
This commit is contained in:
Kumi 2024-08-08 13:15:53 +02:00
parent e983660b55
commit 9c7db1013e
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -136,10 +136,11 @@ $xmr_in_fiat = strtr($xmr_in_fiat, ",", " ");
<select class="input-group-text cursor-pointer" id="selectBox" onchange="xmrConvert(this.value)" aria-label="<?php echo $l_fiatSelect; ?>"> <select class="input-group-text cursor-pointer" id="selectBox" onchange="xmrConvert(this.value)" aria-label="<?php echo $l_fiatSelect; ?>">
<?php <?php
if (isset($xmr_in)) { if (isset($xmr_in)) {
echo '<option value="' . $xmr_in . '">' . $xmr_in . '</option>'; echo '<option value="' . $xmr_in . '">' . (isset(${"l_" . strtolower($xmr_in)}) ? ${"l_" . strtolower($xmr_in)} : $xmr_in) . '</option>';
} }
foreach ($currencies as $currency) { foreach ($currencies as $currency) {
echo "<option value=\"{$currency}\">{$currency}</option>"; $currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency;
echo "<option value=\"{$currency}\">{$currencyName}</option>";
} }
?> ?>
</select> </select>