Moodle
  1. Moodle
  2. MDL-31417

Update list of currencies returned by get_list_of_currencies() and stored in lang/en/currencies.php

    Details

    • Rank:
      37940

      Description

      Noticed that list of currencies has
      $string['SUR'] = 'USSR Rouble';
      (and both the country and currency do not exist for 20 years)
      but does not have currencies of countries of former USSR:
      RUR - Russian Rouble
      UAH - Ukraine Hryvnia
      Belarus Rouble, etc.

      Some other currencies may have changed too over the years

        Issue Links

          Activity

          Show
          Marina Glancy added a comment - http://www.xe.com/iso4217.php http://www.currency-iso.org/iso_index/iso_tables/iso_tables_a1.htm
          Hide
          Marina Glancy added a comment -

          Had A LOT of fun fixing this bug

          Some countries do not exist any more, some currencies do not exist. Some countries (and currencies) started to exist recently. Some currency codes are changed (mistype or result of denomination).

          Also I tried to keep the moodle formation of the name of the currencies. The first word is not the country name but the 'belonging-to-country', i.e. not 'Sweden Krona' but 'Swedish Krona'. For some countries it was not so easy to find the correct spelling.

          And finally there were some mistakes in the list, like 'Schilling' instead of 'Shilling', 'Riyal' instead of 'Rial', etc. I used currencies spelling from ISO.

          Show
          Marina Glancy added a comment - Had A LOT of fun fixing this bug Some countries do not exist any more, some currencies do not exist. Some countries (and currencies) started to exist recently. Some currency codes are changed (mistype or result of denomination). Also I tried to keep the moodle formation of the name of the currencies. The first word is not the country name but the 'belonging-to-country', i.e. not 'Sweden Krona' but 'Swedish Krona'. For some countries it was not so easy to find the correct spelling. And finally there were some mistakes in the list, like 'Schilling' instead of 'Shilling', 'Riyal' instead of 'Rial', etc. I used currencies spelling from ISO.
          Hide
          Helen Foster added a comment -

          Nice work Marina, thanks

          Adding Koen as a watcher for info.

          Show
          Helen Foster added a comment - Nice work Marina, thanks Adding Koen as a watcher for info.
          Hide
          Helen Foster added a comment -

          Can currencies.php be deleted completely then in 2.0, 2.1 and 2.2?

          Show
          Helen Foster added a comment - Can currencies.php be deleted completely then in 2.0, 2.1 and 2.2?
          Hide
          Marina Glancy added a comment -

          the list of currencies in this file is used by get_string_manager()->get_list_of_currencies()

          although this function does not seem to be called anywhere in the core code, we can't delete it from stable versions

          and those changes are to be made in both 2.2 and master

          Show
          Marina Glancy added a comment - the list of currencies in this file is used by get_string_manager()->get_list_of_currencies() although this function does not seem to be called anywhere in the core code, we can't delete it from stable versions and those changes are to be made in both 2.2 and master
          Hide
          Helen Foster added a comment -

          Thanks Marina, perhaps all the strings can be greylisted in AMOS. Adding David as watcher for his consideration.

          Show
          Helen Foster added a comment - Thanks Marina, perhaps all the strings can be greylisted in AMOS. Adding David as watcher for his consideration.
          Hide
          Aparup Banerjee added a comment -

          Hi Marina,

          I'm going through the entire xls here and comparing , I've picked out a few more:

          • AFA -> AFN
          • 'XOF' -> 'CFA Franc BCEAO' and 'XAF' -> 'CFA Franc BEAC'
            there are a few that use XAF, not just central, and above currency names are from iso list so i think that we shouldn't assign the currency to some once country but rather just call the currency by its iso name (atleast for this case).
          • Bolivia has to currencies listed in the iso: BOB and BOV, we're missing 'BOV'
          • 'CLF' > is the Chilean 'Unidades de Fomento', possible typo missing the 's'? maybe translators are better here but thats currency name in the iso.
          • we have 'COP' but no 'COU' for colombia. note : we have defined multiple currency for Cuba (CUC & CUP)

          I think generally we need to look at including the multiple currencies that are possible for a given country/entity in the iso. They could be needed according to regions within the country/entity.

          • IMF's currency lol , SDR , should we include that from the iso? (wikipedia says its not a real currency)
          • ILS is 'New Israeli Sheqel' , not 'shekel'
          • ZAR is for Lesotho , Namibia as well as South Africa.
          • MOP is for MACAO in the iso , we have it spelt as MACAU
          • MKD : 'Macedonia' but we have Makedonian - correct?
          • another anomaly one is the 'XUA' - perhaps its safer we include all possible currencies as defined by iso? would it affect any payment/enrolment if we have all?
          • we have the MXN but no MXV
          • RON -> 'New Romanian Leu'
          • XSU 'sucre' is missing
          • swiss - CHE, CHW (needed?)
          • US has USD, USN, USS (ah: Marina said this is for brokers so its left out.)
          • Uruguay has UYI as well as UYU (we have UYU)

          wow thats the whole iso i've looked through. its funny we don't have XAU which is gold hehe. yep that was fun.

          lets see if we can get this perfect

          cheers,
          Aparup

          ps: i did also wonder if we could use script/scrape/rss in updating this or atleast flagging updating needs.

          Show
          Aparup Banerjee added a comment - Hi Marina, I'm going through the entire xls here and comparing , I've picked out a few more: AFA -> AFN 'XOF' -> 'CFA Franc BCEAO' and 'XAF' -> 'CFA Franc BEAC' there are a few that use XAF, not just central, and above currency names are from iso list so i think that we shouldn't assign the currency to some once country but rather just call the currency by its iso name (atleast for this case). Bolivia has to currencies listed in the iso: BOB and BOV, we're missing 'BOV' 'CLF' > is the Chilean 'Unidades de Fomento', possible typo missing the 's'? maybe translators are better here but thats currency name in the iso. we have 'COP' but no 'COU' for colombia. note : we have defined multiple currency for Cuba (CUC & CUP) I think generally we need to look at including the multiple currencies that are possible for a given country/entity in the iso. They could be needed according to regions within the country/entity. IMF's currency lol , SDR , should we include that from the iso? (wikipedia says its not a real currency) ILS is 'New Israeli Sheqel' , not 'shekel' ZAR is for Lesotho , Namibia as well as South Africa. MOP is for MACAO in the iso , we have it spelt as MACAU MKD : 'Macedonia' but we have Makedonian - correct? another anomaly one is the 'XUA' - perhaps its safer we include all possible currencies as defined by iso? would it affect any payment/enrolment if we have all? we have the MXN but no MXV RON -> 'New Romanian Leu' XSU 'sucre' is missing swiss - CHE, CHW (needed?) US has USD, USN, USS (ah: Marina said this is for brokers so its left out.) Uruguay has UYI as well as UYU (we have UYU) wow thats the whole iso i've looked through. its funny we don't have XAU which is gold hehe. yep that was fun. lets see if we can get this perfect cheers, Aparup ps: i did also wonder if we could use script/scrape/rss in updating this or atleast flagging updating needs.
          Hide
          David Mudrak added a comment -

          This is an old story. We really should sit down and rethink the whole purpose of this file. I already expressed several times that primarily it was a mistake to have that file in the core IMHO. If I remember correctly (sorry, too lazy to check the git log now), it appeared so it could be used by PayPal and other payment-based enrolment plugins. As the language pack maintainer, I objected against having this list of available currencies implemented as strings. You can hardly imagine the pain of translating things like "New Israeli Sheqel" or "Chilean Unidades de Fomento" into Czech. Not only that some of these currencies don't even have a Czech translation but - which is the point - why the heck should any Czech user ever need them displayed in their mother tongue? If I am going to enrol into a Marklar spoken course I am probably expected to understand at least minimum of the Marklar language so I should be able to know how they call their currency. What's the point of having "Marklarian Marklar" currency having translated into dozens of language packs - especially when there is not a single core place that uses it.

          So my suggestion is:

          1. announce the removal of this file from 2.3 immediately (we can convert it into a local/currencies/ which would contain just the language files so the translators' work would not be lost).
          2. encourage the authors of plugins that deal with currencies somehow that they should have their own lists of supported currencies and that should be editable per site (so when I am going to deploy the paypal-like module at my own site I would define my own list of currencies I am going to accept)
          3. if there was a strong demand for the current mechanism, the new local_currencies plugin could be a prerequisite

          p.s. currencies.php and the Loan calculator block were the most absurd parts of Moodle imho. The block has gone. Let's let the list follow it.

          Show
          David Mudrak added a comment - This is an old story. We really should sit down and rethink the whole purpose of this file. I already expressed several times that primarily it was a mistake to have that file in the core IMHO. If I remember correctly (sorry, too lazy to check the git log now), it appeared so it could be used by PayPal and other payment-based enrolment plugins. As the language pack maintainer, I objected against having this list of available currencies implemented as strings. You can hardly imagine the pain of translating things like "New Israeli Sheqel" or "Chilean Unidades de Fomento" into Czech. Not only that some of these currencies don't even have a Czech translation but - which is the point - why the heck should any Czech user ever need them displayed in their mother tongue? If I am going to enrol into a Marklar spoken course I am probably expected to understand at least minimum of the Marklar language so I should be able to know how they call their currency. What's the point of having "Marklarian Marklar" currency having translated into dozens of language packs - especially when there is not a single core place that uses it. So my suggestion is: 1. announce the removal of this file from 2.3 immediately (we can convert it into a local/currencies/ which would contain just the language files so the translators' work would not be lost). 2. encourage the authors of plugins that deal with currencies somehow that they should have their own lists of supported currencies and that should be editable per site (so when I am going to deploy the paypal-like module at my own site I would define my own list of currencies I am going to accept) 3. if there was a strong demand for the current mechanism, the new local_currencies plugin could be a prerequisite p.s. currencies.php and the Loan calculator block were the most absurd parts of Moodle imho. The block has gone. Let's let the list follow it.
          Hide
          Helen Foster added a comment -

          Perhaps currencies.php was actually added to core as an easter egg?

          +1 to everything David suggests.

          Show
          Helen Foster added a comment - Perhaps currencies.php was actually added to core as an easter egg? +1 to everything David suggests.
          Hide
          Marina Glancy added a comment - - edited

          Well, before we decide on this list, I'll finish it anyway (I need it for partners website)

          Thanks Apu for comments.

          AFA -> AFN
          corrected

          'XOF' -> 'CFA Franc BCEAO' and 'XAF' -> 'CFA Franc BEAC'
          there are a few that use XAF, not just central, and above currency names are from iso list so i think that we shouldn't assign the currency to some once country but rather just call the currency by its iso name (atleast for this case).
          or, I'll remove the east/central africa

          Bolivia has to currencies listed in the iso: BOB and BOV, we're missing 'BOV'
          BOV is not used for transactions:
          BOV
          ISO 4217 code for the Bolivian MVDOL. It is a unit of account in Bolivia that does not circulate. It is adjusted for inflation relative to the U.S. dollar so that its value does not change with inflation. Because of this stability, financial instruments in Bolivia are quoted in BOV terms. MVDOL is a Spanish abbreviation for "boliviano maintaining value with respect to the dollar."

          'CLF' > is the Chilean 'Unidades de Fomento', possible typo missing the 's'? maybe translators are better here but thats currency name in the iso.
          this is a plural form, see http://en.wikipedia.org/wiki/Unidad_de_Fomento . Other currencies are listed in singular form

          we have 'COP' but no 'COU' for colombia. note : we have defined multiple currency for Cuba (CUC & CUP)
          I think generally we need to look at including the multiple currencies that are possible for a given country/entity in the iso. They could be needed according to regions within the country/entity.
          again, not used for transactions: http://financial-dictionary.thefreedictionary.com/COU
          COU
          ISO 4217 code for the Colombian unidad de valor real. It is a unit of account in Colombia that does not circulate. It is adjusted for inflation relative to the Colombian peso so that its value remains stable. Because of this stability, major purchases (notably mortgages) in Colombia may be quoted in COU terms.

          IMF's currency lol , SDR , should we include that from the iso? (wikipedia says its not a real currency)
          don't think so

          ILS is 'New Israeli Sheqel' , not 'shekel'
          corrected

          ZAR is for Lesotho , Namibia as well as South Africa.
          it's the official name of the currency http://en.wikipedia.org/wiki/South_African_rand

          MOP is for MACAO in the iso , we have it spelt as MACAU
          well, if you google "MOP Pataca" you will see the results "Macau Pataca" and "Macanese Pataca", but no Macao. Have no idea why it is called that way in iso

          MKD : 'Macedonia' but we have Makedonian - correct?
          the first word is not the name of the country but the belonging-to-country, look at others in the list.

          another anomaly one is the 'XUA' - perhaps its safer we include all possible currencies as defined by iso? would it affect any payment/enrolment if we have all?
          no, there are too much unnecessary stuff in iso

          we have the MXN but no MXV
          not a currency again ( http://en.wikipedia.org/wiki/Mexican_Unidad_de_Inversion )
          The Mexican Unidad de Inversion (ISO 4217 code MXV) is an index unit of funds used in Mexico. It can be traded in many currency markets because its value changes with respect to currencies. Unlike currencies, it is designed to retain its purchasing power and not be subject to inflation. The Mexican credit system (especially mortgages) uses the UDI rather than the peso because of its stability.

          RON -> 'New Romanian Leu'
          First word should be country name, don't forget that the list will be sorted alphabetically by currency name. Besides the denomination was in 2006, so it's not "new" anymore

          XSU 'sucre' is missing
          It is a proposed currency, and looking at what's happenning to euro it is not likely that sucre will ever exist

          swiss - CHE, CHW (needed?)
          no, these are some pseudo-currencies used by WIR bank to account between Swiss franks and euros

          US has USD, USN, USS (ah: Marina said this is for brokers so its left out.)

          Uruguay has UYI as well as UYU (we have UYU)
          funny but I can't find anything about UYI in internet. By the word "Index" in it's name I can assume that it is also not used for transactions

          Show
          Marina Glancy added a comment - - edited Well, before we decide on this list, I'll finish it anyway (I need it for partners website) Thanks Apu for comments. AFA -> AFN corrected 'XOF' -> 'CFA Franc BCEAO' and 'XAF' -> 'CFA Franc BEAC' there are a few that use XAF, not just central, and above currency names are from iso list so i think that we shouldn't assign the currency to some once country but rather just call the currency by its iso name (atleast for this case). or, I'll remove the east/central africa Bolivia has to currencies listed in the iso: BOB and BOV, we're missing 'BOV' BOV is not used for transactions: BOV ISO 4217 code for the Bolivian MVDOL. It is a unit of account in Bolivia that does not circulate . It is adjusted for inflation relative to the U.S. dollar so that its value does not change with inflation. Because of this stability, financial instruments in Bolivia are quoted in BOV terms. MVDOL is a Spanish abbreviation for "boliviano maintaining value with respect to the dollar." 'CLF' > is the Chilean 'Unidades de Fomento', possible typo missing the 's'? maybe translators are better here but thats currency name in the iso. this is a plural form, see http://en.wikipedia.org/wiki/Unidad_de_Fomento . Other currencies are listed in singular form we have 'COP' but no 'COU' for colombia. note : we have defined multiple currency for Cuba (CUC & CUP) I think generally we need to look at including the multiple currencies that are possible for a given country/entity in the iso. They could be needed according to regions within the country/entity. again, not used for transactions: http://financial-dictionary.thefreedictionary.com/COU COU ISO 4217 code for the Colombian unidad de valor real. It is a unit of account in Colombia that does not circulate. It is adjusted for inflation relative to the Colombian peso so that its value remains stable. Because of this stability, major purchases (notably mortgages) in Colombia may be quoted in COU terms. IMF's currency lol , SDR , should we include that from the iso? (wikipedia says its not a real currency) don't think so ILS is 'New Israeli Sheqel' , not 'shekel' corrected ZAR is for Lesotho , Namibia as well as South Africa. it's the official name of the currency http://en.wikipedia.org/wiki/South_African_rand MOP is for MACAO in the iso , we have it spelt as MACAU well, if you google "MOP Pataca" you will see the results "Macau Pataca" and "Macanese Pataca", but no Macao. Have no idea why it is called that way in iso MKD : 'Macedonia' but we have Makedonian - correct? the first word is not the name of the country but the belonging-to-country, look at others in the list. another anomaly one is the 'XUA' - perhaps its safer we include all possible currencies as defined by iso? would it affect any payment/enrolment if we have all? no, there are too much unnecessary stuff in iso we have the MXN but no MXV not a currency again ( http://en.wikipedia.org/wiki/Mexican_Unidad_de_Inversion ) The Mexican Unidad de Inversion (ISO 4217 code MXV) is an index unit of funds used in Mexico. It can be traded in many currency markets because its value changes with respect to currencies. Unlike currencies, it is designed to retain its purchasing power and not be subject to inflation. The Mexican credit system (especially mortgages) uses the UDI rather than the peso because of its stability. RON -> 'New Romanian Leu' First word should be country name, don't forget that the list will be sorted alphabetically by currency name. Besides the denomination was in 2006, so it's not "new" anymore XSU 'sucre' is missing It is a proposed currency, and looking at what's happenning to euro it is not likely that sucre will ever exist swiss - CHE, CHW (needed?) no, these are some pseudo-currencies used by WIR bank to account between Swiss franks and euros US has USD, USN, USS (ah: Marina said this is for brokers so its left out.) Uruguay has UYI as well as UYU (we have UYU) funny but I can't find anything about UYI in internet. By the word "Index" in it's name I can assume that it is also not used for transactions
          Hide
          Aparup Banerjee added a comment -

          for master:
          i've added some watchers here to decide if we really need currencies.php here as suggested by David (or anyone else in some old and as yet unlinked issue).

          note if we do (1,2/3) we need to plan and document this change properly before we move ahead with any changes.

          for stable:
          will be integrated once changes/corrections done.

          Show
          Aparup Banerjee added a comment - for master: i've added some watchers here to decide if we really need currencies.php here as suggested by David (or anyone else in some old and as yet unlinked issue). note if we do (1,2/3) we need to plan and document this change properly before we move ahead with any changes. for stable: will be integrated once changes/corrections done.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          My +1 goes to:

          1) Apply the fixes to all current supported branches (21, 22, master).
          2) Create followup issue about to move currencies out from core, surely to local as commented above and document @ upgrade.txt and Docs (release notes) about it.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - My +1 goes to: 1) Apply the fixes to all current supported branches (21, 22, master). 2) Create followup issue about to move currencies out from core, surely to local as commented above and document @ upgrade.txt and Docs (release notes) about it. Ciao
          Hide
          Helen Foster added a comment -

          Having had David explaining in person why currencies.php is completely ridiculous, I recommend that no more time is wasted on this issue.

          I don't understand how the file can possibly be needed on the partners site. Who is going to translate 'Marklarian Marklar' into their language and for what purpose?

          Show
          Helen Foster added a comment - Having had David explaining in person why currencies.php is completely ridiculous, I recommend that no more time is wasted on this issue. I don't understand how the file can possibly be needed on the partners site. Who is going to translate 'Marklarian Marklar' into their language and for what purpose?
          Hide
          Aparup Banerjee added a comment -

          Eloy, sounds like a good plan to me

          Show
          Aparup Banerjee added a comment - Eloy, sounds like a good plan to me
          Hide
          Aparup Banerjee added a comment -

          linking MDL-31567 for handling currencies.php's move out of core into local plugin.

          Show
          Aparup Banerjee added a comment - linking MDL-31567 for handling currencies.php's move out of core into local plugin.
          Hide
          Marina Glancy added a comment -

          Did not see that Apu has already created an issue and created another one.
          We should decide which way to move

          Show
          Marina Glancy added a comment - Did not see that Apu has already created an issue and created another one. We should decide which way to move
          Hide
          Aparup Banerjee added a comment -

          cool, these changes have been integrated into master, 22 and 21.

          Show
          Aparup Banerjee added a comment - cool, these changes have been integrated into master, 22 and 21.
          Hide
          Aparup Banerjee added a comment -

          passing too!

          Show
          Aparup Banerjee added a comment - passing too!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          A bit later this week, but finally your changes have been accepted and are now available in all the upstream git/cvs servers.

          Many thanks & ciao

          Show
          Eloy Lafuente (stronk7) added a comment - A bit later this week, but finally your changes have been accepted and are now available in all the upstream git/cvs servers. Many thanks & ciao

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: