Moodle
  1. Moodle
  2. MDL-31567

move unused currencies.php out of core and into a local plugin

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
    • Testing Instructions:
      Hide

      Verify no regressions (upgrading etc) secnarios possible once currencies.php is removed from master.

      maybe also verify the documentation is available and explanatory for this change

      Show
      Verify no regressions (upgrading etc) secnarios possible once currencies.php is removed from master. maybe also verify the documentation is available and explanatory for this change
    • Affected Branches:
      MOODLE_23_STABLE
    • Rank:
      38122

      Description

      In MDL-31417 we updated the currencies.php to reflect the latest iso standards.

      It was however noted that currencies.php isn't very relevant to core and might be better located as a local plugin ; see David's comment .

      Hence this issue is about moving currencies.php into a local plugin and documenting this change well.

        Issue Links

          Activity

          Aparup Banerjee created issue -
          Aparup Banerjee made changes -
          Field Original Value New Value
          Link This issue has been marked as being related by MDL-31417 [ MDL-31417 ]
          Michael de Raadt made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Labels triaged
          Hide
          Martin Dougiamas added a comment -

          Hmm, I don't agree.

          Currencies are universal (why should people have to install a whole plugin to get something so basic), it's used by core modules like /enrol/paypal anyway, and the names of them are localised words (that's why they were in the language packs). It's totally something that should be in core IMO.

          Translators don't have to translate them if they don't want to.

          Show
          Martin Dougiamas added a comment - Hmm, I don't agree. Currencies are universal (why should people have to install a whole plugin to get something so basic), it's used by core modules like /enrol/paypal anyway, and the names of them are localised words (that's why they were in the language packs). It's totally something that should be in core IMO. Translators don't have to translate them if they don't want to.
          Helen Foster made changes -
          Link This issue is duplicated by MDL-31568 [ MDL-31568 ]
          Hide
          Koen Roggemans added a comment -

          As far as I can see, the localised currencies are nowhere used, not even in Paypal. Not sure, but that seems to have its own hard coded English list of currencies

          $paypalcurrencies = array('USD' => 'US Dollars',
          'EUR' => 'Euros',
          'JPY' => 'Japanese Yen',
          'GBP' => 'British Pounds',
          'CAD' => 'Canadian Dollars',
          'AUD' => 'Australian Dollars'
          );

          I can see your point that it is nice to have the possibility to call something universal as localised currencies. But we can't create and translate all possible lists that any developer might want to use in the core part of the language packs.

          We have already +16000 strings, with no way for translators to find out which ones are often used, used for students, sometimes used or never used. That is not very encouraging to start a new language pack.
          It also gives a wrong idea about what a good language pack is. E.g while using the Dutch language pack, which is around 80% complete (not currencies ), you will never see any English. But for an outsider, looking at the download page, it seems like there is one out of five strings missing.

          So, from a translators point of view, my +1 to keep the number of strings as low as possible and take unused ones, like this set, out of the core language pack.

          Show
          Koen Roggemans added a comment - As far as I can see, the localised currencies are nowhere used, not even in Paypal. Not sure, but that seems to have its own hard coded English list of currencies $paypalcurrencies = array('USD' => 'US Dollars', 'EUR' => 'Euros', 'JPY' => 'Japanese Yen', 'GBP' => 'British Pounds', 'CAD' => 'Canadian Dollars', 'AUD' => 'Australian Dollars' ); I can see your point that it is nice to have the possibility to call something universal as localised currencies. But we can't create and translate all possible lists that any developer might want to use in the core part of the language packs. We have already +16000 strings, with no way for translators to find out which ones are often used, used for students, sometimes used or never used. That is not very encouraging to start a new language pack. It also gives a wrong idea about what a good language pack is. E.g while using the Dutch language pack, which is around 80% complete (not currencies ), you will never see any English. But for an outsider, looking at the download page, it seems like there is one out of five strings missing. So, from a translators point of view, my +1 to keep the number of strings as low as possible and take unused ones, like this set, out of the core language pack.
          Hide
          David Mudrak added a comment -

          Martin, I already expressed my point of view in the linked comment. The argument that translators can leave some strings untranslated is not valid imho. Both translators and community just expect 100% of localised strings as the goal.

          Not all currencies have their names in all other languages. And definitively, if any part of Moodle decides to use any list of currencies, hardly they support all currencies. Even with PayPal and friends, only a limited set of currencies is expected/supported - PayPal itself supports 18 currencies and provides their names localized in 4 languages only. So even if all our translators spend half of their lives on translating currencies.php, users will never need it. And having it translated may make the case even worse ("how does PayPal call the currency that my Moodle calls

          {something}

          ?").

          And Koen is right, for sure. Neither enrol_authorize nor enrol_paypal use this file (and I do not consider it a bug).

          I would really be interested in any use case for using this list. Hardly I can imagine that someone just says they accept payments in any currency. It's always a very limited list. If such a site is mono-lingual, they do not have to have currencies.php. If the site is multilingual, currency codes work better imho and are unique.

          Show
          David Mudrak added a comment - Martin, I already expressed my point of view in the linked comment. The argument that translators can leave some strings untranslated is not valid imho. Both translators and community just expect 100% of localised strings as the goal. Not all currencies have their names in all other languages. And definitively, if any part of Moodle decides to use any list of currencies, hardly they support all currencies. Even with PayPal and friends, only a limited set of currencies is expected/supported - PayPal itself supports 18 currencies and provides their names localized in 4 languages only. So even if all our translators spend half of their lives on translating currencies.php, users will never need it. And having it translated may make the case even worse ("how does PayPal call the currency that my Moodle calls {something} ?"). And Koen is right, for sure. Neither enrol_authorize nor enrol_paypal use this file (and I do not consider it a bug). I would really be interested in any use case for using this list. Hardly I can imagine that someone just says they accept payments in any currency. It's always a very limited list. If such a site is mono-lingual, they do not have to have currencies.php. If the site is multilingual, currency codes work better imho and are unique.
          Hide
          Aparup Banerjee added a comment -

          On the issue of 80% complete lang packs which are actually 100% ,perhaps we can flag these files some way so that being optionally translatable might help show a more realistic statistic for lang packs. any generated statistics would have to be tweaked too.
          better yet, perhaps moving it into something like lang/universe/currencies.php so that would mean those strings translations don't need translations.

          Show
          Aparup Banerjee added a comment - On the issue of 80% complete lang packs which are actually 100% ,perhaps we can flag these files some way so that being optionally translatable might help show a more realistic statistic for lang packs. any generated statistics would have to be tweaked too. better yet, perhaps moving it into something like lang/universe/currencies.php so that would mean those strings translations don't need translations.
          Petr Škoda made changes -
          Link This issue has been marked as being related by MDL-7537 [ MDL-7537 ]
          Petr Škoda made changes -
          Assignee moodle.com [ moodle.com ] Petr Škoda [ skodak ]
          Hide
          Petr Škoda added a comment -

          1/ The currencies are now used from PayPal MDL-7537, the currencies list is based on ISO 4217.

          2/ Clearly this list must have been translated many times before, all we need to do is to import it into amos.

          3/ We could use both the ISO code and localised currency name to prevent any confusion.

          I am going to review and cleanup the list in separate issue if necessary...

          Show
          Petr Škoda added a comment - 1/ The currencies are now used from PayPal MDL-7537 , the currencies list is based on ISO 4217. 2/ Clearly this list must have been translated many times before, all we need to do is to import it into amos. 3/ We could use both the ISO code and localised currency name to prevent any confusion. I am going to review and cleanup the list in separate issue if necessary...
          Petr Škoda made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Not a bug [ 7 ]

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: