MediaWiki:Resources/CurrencyLocalize.js
Jump to navigation
Jump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
<html>
<script type="text/javascript" language="javascript">
function currencyLocalize(currency, amount, language){
var currencies = {
"USD" : "$\t",
"EUR" : {
"it" : "\t€",
"pt" : "\t€",
"default" : "€\t"
},
"AED" : " د.إ \t",
"ANG" : "ƒ\t",
"ARS" : "$\t",
"AUD" : "$\t",
"BDT" : "\t৳",
"BGN" : "лв\t",
"BHD" : "د.ب\t",
"BMD" : "BD$\t",
"BOB" : "$b\t",
"BRL" : "R$\t",
"CAD" : {
"fr" : "$\t",
"default" : "$\t"
},
"CHF" : "Fr. \t",
"CLP" : "$\t",
"CNY" : "\t ¥",
"COP" : "$\t",
"CRC" : "\t ₡",
"CZK" : "\t Kč",
"DKK" : "\t kr",
"DOP" : "RD$\t",
"DZD" : "د.ج\t",
"EEK" : "\t kr",
"EGP" : {
"en" : "E£\t",
"default" : "\t جنيه"
},
"FJD" : "$\t",
"GBP" : "£\t",
"GTQ" : "Q\t",
"HKD" : "$\t",
"HNL" : "\t L",
"HRK" : "\t kn",
"HUF" : "\t Ft",
"IDR" : "Rp \t",
"ILS" : "₪ \t",
"INR" : "Rs. \t",
"JMD" : "J$ \t",
"JOD" : "دينار\t",
"JPY" : "¥\t",
"KES" : "\t KSh",
"KRW" : "₩ \t",
"KWD" : "د.ك \t",
"KZT" : "〒 \t", // TODO: don't use the JP postal code symbol once KZT works in unicode
"LBP" : "£\t",
"LKR" : "\t Rs.",
"LTL" : "\t Lt",
"LVL" : "\t Ls",
"MAD" : "د.م.\t",
"MKD" : "\t ден",
"MOP" : "MOP$\t",
"MUR" : "\t Rs",
"MXN" : "$\t",
"MVR" : "Rf. \t",
"NIO" : "C$\t",
"NOK" : "\t kr",
"NZD" : "$\t",
"OMR" : "ر.ع\t",
"PAB" : "\t B/.",
"PEN" : "\t S/.",
"PHP" : "₱\t",
"PKR" : "Rs \t",
"PLN" : "\t zł",
"PYG" : "₲\t",
"QAR" : "ر.ق\t",
"RON" : "\t lei",
"RUB" : "\t руб",
"SAR" : "﷼\t",
"SCR" : "SR \t",
"SEK" : "\t kr",
"SGD" : "S$ \t",
"SVC" : "\t ₡",
"THB" : "\t ฿",
"TTD" : "TT$\t",
"TWD" : "NT$\t",
"TZS" : "\t/=",
"UAH" : "₴\t",
"UYU" : "$U \t",
"UZS" : "\t сўм",
"VND" : "\t₫",
"VUV" : "VT\t",
"XAF" : "FCFA\t",
"XCD" : "EC$\t",
"XOF" : "CFA \t",
"XPF" : "\t F",
"ZAR" : "R \t"
};
if(currencies[currency] == null){
return currency + " " + amount;
}
if( currencies[currency] instanceof Object ){ // not a string
if(currencies[currency][language] != null){
return currencies[currency][language].replace("\t", amount)
}
return currencies[currency]["default"].replace("\t", amount)
}
return currencies[currency].replace("\t", amount)
}
</script>
</html>