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

Misleading debugging info in the collator class



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Language, Libraries
    • Labels:


      The whole story behind this simple patch started at https://moodle.org/mod/forum/discuss.php?d=244787 which led to MDLSITE-2580 being reported.

      While I was working on the issue and have learnt how the collator class deals with locales defined in Moodle language packs, I realized that the debugging message printed by ensure_collator_available() method are kind of misleading, or better they do not fully describe what's going on.

      In our case, the debugging message reads

      Invalid locale: "bg_BG.UTF-8", with warning (not fatal) "U_USING_FALLBACK_WARNING", falling back to "bg"

      which does not give a clue why it was thrown at all as the collator should just use the "bg" locale silently.

      The patch I'm submitting improves the debugging message so that it reads

      Locale warning (not fatal) "U_USING_FALLBACK_WARNING": Requested locale "bg_BG.UTF-8" not found, locale "ru" used instead. The most specific locale supported by ICU relatively to the requested locale is "bg".

      which explains more as it gives us a hint that "ru" was for some - yet unknown - reason picked as the actual locale instead of the expected Bulgarian one.


          Issue Links



              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created:
                  Fix Release Date: