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

Wrong month cases in the calendar. %B format.

XMLWordPrintable

      There is a problem with month cases in the calendar.

      Moodle currently does not have any mechanisms of taking cases into account.
      In regular language strings, the problem with cases is usually solved by specifying local translations of the strings. But the calendar displays month names that are taken not from translated language strings, but from the server locales, and language strings are used to specify the date format.

      There are strings in the language pack configs:
      $string['strftimemonth'] = '%B'; - used only to go to the previous and next months in the calendar.
      $string['strftimemonthyear'] = '%B %Y'; - Used only in the calendar as a header where the month is displayed, as text for links to the calendar, and in breadcrumbs.

      The problem is in using '%B' in the month format. This format means the full spelling of the month. In the locale, the full month name is set so that it looks correct in the full date (formats containing the day before the month, '%d %B %Y'). However, if there is no day before the month name, the date becomes incorrect. Something like 'of October' and 'of October 2024'.

      The problem can be solved by using the abbreviated month format '%b' in the specified strings. In this case, the abbreviated month format will be used, in which case will not matter.

      *For languages ​​with this problem, we suggest changing the strftimemonth and strftimemonthyear strings as follows:*
      $string['strftimemonth'] = '%b';
      $string['strftimemonthyear'] = '%b %Y';

      Presumably, such a problem can arise in many languages ​​where there are cases, for example, in all Cyrillic languages ​​(Ukrainian, Czech, Bulgarian, Serbian, Belarusian, etc.), so it makes sense to solve this problem systematically by developing appropriate mechanisms.

      The screenshots are given in English with slight modifications to make the problem clearer to the English speaker, even though there is no problem with English itself due to lack of cases in the monthes.

        1. (1) 3 Passed -- (Main)MDL-83412.png
          26 kB
          Kim Jared Lucas
        2. (1) 4-2 Passed -- (Main)MDL-83412.png
          127 kB
          Kim Jared Lucas
        3. (1) 4 Passed -- (Main)MDL-83412.png
          99 kB
          Kim Jared Lucas
        4. (1) 6 Passed -- (Main)MDL-83412.png
          68 kB
          Kim Jared Lucas
        5. 83412-october-example.png
          102 kB
          Andrew Lyons
        6. calendar_eng_full_modified.png
          80 kB
          Андрей Усков
        7. calendar_eng_short.png
          76 kB
          Андрей Усков
        8. test_83412.php
          1 kB
          Andrew Lyons

            dobedobedoh Andrew Lyons
            андрейусков Андрей Усков
            Ruslan Kabalin Ruslan Kabalin
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 6 minutes
                2h 6m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.