'zh-hans', 'zh-hk' => 'zh-hant', 'zh-tw' => 'zh-hant', 'zh-cn' => 'zh-hans', 'zh-sg' => 'zh-hans', 'zh-mo' => 'zh-hant', ]; if (isset($aliases[$lang])) { $lang = $aliases[$lang]; } // Load the language files // Take English as a base, then overwrite with the browser language // E.g.: First load en.php, then de.php, then de-at.php $language_code = explode('-', $lang)[0]; $language_files = ["en", $language_code, $lang]; foreach ($language_files as $language_file) { if (file_exists('lang/' . $language_file . '.php')) { require_once 'lang/' . $language_file . '.php'; } } // Calculation through GET parameters $xmr_in = isset($_GET["in"]) ? strtoupper(htmlspecialchars($_GET["in"])) : 'EUR'; $xmr_amount = isset($_GET["xmr"]) ? floatval($_GET["xmr"]) : 1; $fiat_amount = isset($_GET["fiat"]) ? floatval($_GET["fiat"]) : ''; $conversion_direction = isset($_GET["direction"]) ? intval($_GET["direction"]) : 0; if ($conversion_direction == 0) { $fiat_value = $xmr_amount * $exchangeRates[$xmr_in]; $xmr_value = $xmr_amount; } else { $xmr_value = $fiat_amount / $exchangeRates[$xmr_in]; $fiat_value = $fiat_amount; } $fiat_value = number_format($fiat_value, ($xmr_in == 'BTC' || $xmr_in == 'LTC' || $xmr_in == 'ETH' || $xmr_in == 'XAG' || $xmr_in == 'XAU') ? 8 : 2); $xmr_value = number_format($xmr_value, 12); $fiat_value = strtr($fiat_value, ",", " "); // Order preferred currencies to the top foreach (array_reverse($preferred_currencies) as $currency) { $currency = strtoupper($currency); if (($key = array_search($currency, $currencies)) !== false) { unset($currencies[$key]); array_unshift($currencies, $currency); } } // Output the HTML require 'templates/index.php'; ?>