Small custom: currency list sorted by ISO 4217

3 replies [Last post]
Joined: 01/05/2008
Juice: 19

Сurrency list sorted by english currency names looks like random one after translating. Small custom for all non-english speaking people: list sorted by ISO 4217 code. This will more usable if you add code before curreny name in your translation: 'Russian Rouble (RUB)' -> '(RUB) Российский рубль':)

You can find this in line 2710 of uc_store.module.

<?php
/*Line 2710 of uc_store.module */
if (!function_exists('currency_api_get_list')){
  function
currency_api_get_list() {
   
$currency = array(
     
'AED' => t('UAE Dirham (AED)'),
     
'AFA' => t('Afghanistan Afghani (AFA)'),
     
'ALL' => t('Albanian Lek (ALL)'),
     
'ANG' => t('Neth Antilles Guilder (ANG)'),
     
'ARS' => t('Argentine Peso (ARS)'),
     
'AUD' => t('Australian Dollar (AUD)'),
     
'AWG' => t('Aruba Florin (AWG)'),
     
'BBD' => t('Barbados Dollar (BBD)'),
     
'BDT' => t('Bangladesh Taka (BDT)'),
     
'BGN' => t('Bulgarian Lev (BGN)'),
     
'BHD' => t('Bahraini Dinar (BHD)'),
     
'BIF' => t('Burundi Franc (BIF)'),
     
'BMD' => t('Bermuda Dollar (BMD)'),
     
'BND' => t('Brunei Dollar (BND)'),
     
'BOB' => t('Bolivian Boliviano (BOB)'),
     
'BRL' => t('Brazilian Real (BRL)'),
     
'BSD' => t('Bahamian Dollar (BSD)'),
     
'BTN' => t('Bhutan Ngultrum (BTN)'),
     
'BWP' => t('Botswana Pula (BWP)'),
     
'BYR' => t('Belarus Ruble (BYR)'),
     
'BZD' => t('Belize Dollar (BZD)'),
     
'CAD' => t('Canadian Dollar (CAD)'),
     
'CHF' => t('Swiss Franc (CHF)'),
     
'CLP' => t('Chilean Peso (CLP)'),
     
'CNY' => t('Chinese Yuan (CNY)'),
     
'COP' => t('Colombian Peso (COP)'),
     
'CRC' => t('Costa Rica Colon (CRC)'),
     
'CUP' => t('Cuban Peso (CUP)'),
     
'CVE' => t('Cape Verde Escudo (CVE)'),
     
'CYP' => t('Cyprus Pound (CYP)'),
     
'CZK' => t('Czech Koruna (CZK)'),
     
'DJF' => t('Dijibouti Franc (DJF)'),
     
'DKK' => t('Danish Krone (DKK)'),
     
'DOP' => t('Dominican Peso (DOP)'),
     
'DZD' => t('Algerian Dinar (DZD)'),
     
'ECS' => t('Ecuador Sucre (ECS)'),
     
'EEK' => t('Estonian Kroon (EEK)'),
     
'EGP' => t('Egyptian Pound (EGP)'),
     
'ERN' => t('Eritrea Nakfa (ERN)'),
     
'ETB' => t('Ethiopian Birr (ETB)'),
     
'EUR' => t('Euro (EUR)'),
     
'FJD' => t('Fiji Dollar (FJD)'),
     
'FKP' => t('Falkland Islands Pound (FKP)'),
     
'GBP' => t('British Pound (GBP)'),
     
'GHC' => t('Ghanian Cedi (GHC)'),
     
'GIP' => t('Gibraltar Pound (GIP)'),
     
'GMD' => t('Gambian Dalasi (GMD)'),
     
'GNF' => t('Guinea Franc (GNF)'),
     
'GTQ' => t('Guatemala Quetzal (GTQ)'),
     
'GYD' => t('Guyana Dollar (GYD)'),
     
'HKD' => t('Hong Kong Dollar (HKD)'),
     
'HNL' => t('Honduras Lempira (HNL)'),
     
'HRK' => t('Croatian Kuna (HRK)'),
     
'HTG' => t('Haiti Gourde (HTG)'),
     
'HUF' => t('Hungarian Forint (HUF)'),
     
'IDR' => t('Indonesian Rupiah (IDR)'),
     
'ILS' => t('Israeli Shekel (ILS)'),
     
'INR' => t('Indian Rupee (INR)'),
     
'IQD' => t('Iraqi Dinar (IQD)'),
     
'IRR' => t('Iran Rial (IRR)'),
     
'ISK' => t('Iceland Krona (ISK)'),
     
'JMD' => t('Jamaican Dollar (JMD)'),
     
'JOD' => t('Jordanian Dinar (JOD)'),
     
'JPY' => t('Japanese Yen (JPY)'),
     
'KES' => t('Kenyan Shilling (KES)'),
     
'KHR' => t('Cambodia Riel (KHR)'),
     
'KMF' => t('Comoros Franc (KMF)'),
     
'KPW' => t('North Korean Won (KPW)'),
     
'KRW' => t('Korean Won (KRW)'),
     
'KWD' => t('Kuwaiti Dinar (KWD)'),
     
'KYD' => t('Cayman Islands Dollar (KYD)'),
     
'KZT' => t('Kazakhstan Tenge (KZT)'),
     
'LAK' => t('Lao Kip (LAK)'),
     
'LBP' => t('Lebanese Pound (LBP)'),
     
'LKR' => t('Sri Lanka Rupee (LKR)'),
     
'LRD' => t('Liberian Dollar (LRD)'),
     
'LSL' => t('Lesotho Loti (LSL)'),
     
'LTL' => t('Lithuanian Lita (LTL)'),
     
'LVL' => t('Latvian Lat (LVL)'),
     
'LYD' => t('Libyan Dinar (LYD)'),
     
'MAD' => t('Moroccan Dirham (MAD)'),
     
'MDL' => t('Moldovan Leu (MDL)'),
     
'MGF' => t('Malagasy Franc (MGF)'),
     
'MKD' => t('Macedonian Denar (MKD)'),
     
'MMK' => t('Myanmar Kyat (MMK)'),
     
'MNT' => t('Mongolian Tugrik (MNT)'),
     
'MOP' => t('Macau Pataca (MOP)'),
     
'MRO' => t('Mauritania Ougulya (MRO)'),
     
'MTL' => t('Maltese Lira (MTL)'),
     
'MUR' => t('Mauritius Rupee (MUR)'),
     
'MVR' => t('Maldives Rufiyaa (MVR)'),
     
'MWK' => t('Malawi Kwacha (MWK)'),
     
'MXN' => t('Mexican Peso (MXN)'),
     
'MYR' => t('Malaysian Ringgit (MYR)'),
     
'MZM' => t('Mozambique Metical (MZM)'),
     
'NAD' => t('Namibian Dollar (NAD)'),
     
'NGN' => t('Nigerian Naira (NGN)'),
     
'NIO' => t('Nicaragua Cordoba (NIO)'),
     
'NOK' => t('Norwegian Krone (NOK)'),
     
'NPR' => t('Nepalese Rupee (NPR)'),
     
'NZD' => t('New Zealand Dollar (NZD)'),
     
'OMR' => t('Omani Rial (OMR)'),
     
'PAB' => t('Panama Balboa (PAB)'),
     
'PEN' => t('Peruvian Nuevo Sol (PEN)'),
     
'PGK' => t('Papua New Guinea Kina (PGK)'),
     
'PHP' => t('Philippine Peso (PHP)'),
     
'PKR' => t('Pakistani Rupee (PKR)'),
     
'PLN' => t('Polish Zloty (PLN)'),
     
'PYG' => t('Paraguayan Guarani (PYG)'),
     
'QAR' => t('Qatar Rial (QAR)'),
     
'ROL' => t('Romanian Leu (ROL)'),
     
'RUB' => t('Russian Rouble (RUB)'),
     
'RWF' => t('Rwanda Franc (RWF)'),
     
'SAR' => t('Saudi Arabian Riyal (SAR)'),
     
'SBD' => t('Solomon Islands Dollar (SBD)'),
     
'SCR' => t('Seychelles Rupee (SCR)'),
     
'SDD' => t('Sudanese Dinar (SDD)'),
     
'SEK' => t('Swedish Krona (SEK)'),
     
'SGD' => t('Singapore Dollar (SGD)'),
     
'SHP' => t('St Helena Pound (SHP)'),
     
'SIT' => t('Slovenian Tolar (SIT)'),
     
'SKK' => t('Slovak Koruna (SKK)'),
     
'SLL' => t('Sierra Leone Leone (SLL)'),
     
'SOS' => t('Somali Shilling (SOS)'),
     
'SRG' => t('Surinam Guilder (SRG)'),
     
'STD' => t('Sao Tome Dobra (STD)'),
     
'SVC' => t('El Salvador Colon (SVC)'),
     
'SYP' => t('Syrian Pound (SYP)'),
     
'SZL' => t('Swaziland Lilageni (SZL)'),
     
'THB' => t('Thai Baht (THB)'),
     
'TND' => t('Tunisian Dinar (TND)'),
     
'TOP' => t('Tonga Pa\'anga (TOP)'),
     
'TRL' => t('Turkish Lira (TRL)'),
     
'TTD' => t('Trinidad & Tobago Dollar (TTD)'),
     
'TWD' => t('Taiwan Dollar (TWD)'),
     
'TZS' => t('Tanzanian Shilling (TZS)'),
     
'UAH' => t('Ukraine Hryvnia (UAH)'),
     
'UGX' => t('Ugandan Shilling (UGX)'),
     
'USD' => t('U.S. Dollar (USD)'),
     
'UYU' => t('Uruguayan New Peso (UYU)'),
     
'VEB' => t('Venezuelan Bolivar (VEB)'),
     
'VND' => t('Vietnam Dong (VND)'),
     
'VUV' => t('Vanuatu Vatu (VUV)'),
     
'WST' => t('Samoa Tala (WST)'),
     
'XAF' => t('CFA Franc (BEAC) (XAF)'),
     
'XAG' => t('Silver Ounces (XAG)'),
     
'XAU' => t('Gold Ounces (XAU)'),
     
'XCD' => t('East Caribbean Dollar (XCD)'),
     
'XOF' => t('CFA Franc (BCEAO) (XOF)'),
     
'XPD' => t('Palladium Ounces (XPD)'),
     
'XPF' => t('Pacific Franc (XPF)'),
     
'XPT' => t('Platinum Ounces (XPT)'),
     
'YER' => t('Yemen Riyal (YER)'),
     
'YUM' => t('Yugoslav Dinar (YUM)'),
     
'ZAR' => t('South African Rand (ZAR)'),
     
'ZMK' => t('Zambian Kwacha (ZMK)'),
     
'ZWD' => t('Zimbabwe Dollar (ZWD)'),
    );
    return
$currency;
  }
}
?>

Nosce te ipsum

Joined: 08/07/2007
Juice: 15375

Lyle pointed out that he just copied/pasted the list from the currency API module. We don't mind having a different version, but this might also be something to address in their issue tracker. Puzzled

In any event, I've reordered the list in the store module per your post. Thanks! Smiling

Joined: 01/05/2008
Juice: 19

Thank you very much. I think, that the given code will make Ubercart more conveniently for not English-speaking users and translators. I apologise, that has not used issue tracker, simply I believed, that the given code will be actual for a small number of users:).

Nosce te ipsum

Joined: 08/07/2007
Juice: 15375

Yeah, no problem. We're totally cool having a different selection than offered by the currency module, so no need to raise the issue there. Smiling