Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73967

Consider deprecating decsep/thousandssep and move to localecldr

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Minor
    • None
    • 3.11.5, 4.0, 4.1
    • General, Gradebook, Language
    • None
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE

    Description

      This issue has been created while working on MDL-73824.

      Right now we have 2 ways to decide about how to format / unformat floats is Moodle.

      1. The original one (since the night of the times), where both the decsep and thousandssep lang strings decide the separators to use for every language. Both the PARAM_LOCALISEDFLOAT and the format/unformat_float() functions use those lang strings.
      1. A new one, based on localecldr, right now only used by the payment subsystem/plugins (because they have some advanced/special requirements about number formatting, only provided by CLDR handling.

      The point is that, somehow, the new localecldr (2) "predates" the need of the old (1) ones, because it provides the same and more.

      Plus, its wouldn't be very hard to patch PARAM_LOCALISEDFLOAT and the format/unformat_float() functions to start using the CLDR alternative.

      Also, it would be a great moment to check all the remaining uses in core using the "old" decsep and thousandssep because maybe they aren't correct and need to be wrapped within some of the param/functions above.

      Surely this will need to be a "slow deprecation", keeping the old separators for a long time... but we could start warning about them and homogenize all core uses.

      Not critical at all, but a good normalization and cleanup.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: