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

Letter avatars should respect the preference which should come first family or given names

XMLWordPrintable

    • HQ 2023 Planning i4 Moppies

      In the current letter avatars, given names (first names) come first. However, this is not preferred in Asian locales (including Japanese and Chinese). If family names (last names) come first in display names in the current locale, letter avatars must respect the preference.

       

      How to reproduce:

       

      1. Install the Japanese locale (or other locales of languages where family names come first)
      2. Create users (see the examples below)
      3. Switch to the user
      4. Change the locale to Japanese
      5. Check the text avatar

       

      User info examples (locale is always ja (Japanese)):

      1. Hara Takashi

      • First name: 敬 (=Takashi)
      • Last name: 原 (=HARA)
      • Name displayed in Japanese: 原 敬
      • Expected letter avatar: 原敬
      • Actual letter avatar: 敬原

      2. Chun-Li

      • First name: 麗 (=Li)
      • Last name: 春 (=Chun)
      • Name displayed in Japanese (and probably Chinese): 春 麗
      • Expected letter avatar: 春麗
      • Actual letter avatar: 麗春

       

      core_renderer::render_user_picture in lib/outputrenderers.php must be fixed to fix this problem.

       

                  $output = html_writer::tag('span', mb_substr($user->firstname, 0, 1) . mb_substr($user->lastname, 0, 1), 

      ↑ This must be fixed. At least we must check the value $CFG->fullnamedisplay.

        1. 0001-MDL-77274-core_renderer-Respect-full-name-format-in-.patch
          6 kB
        2. MDL-77274_401.png
          MDL-77274_401.png
          62 kB
        3. MDL-77274_402.png
          MDL-77274_402.png
          56 kB
        4. MDL-77274_403.png
          MDL-77274_403.png
          64 kB
        5. MDL-77274_master.png
          MDL-77274_master.png
          62 kB
        6. screenshot-1.png
          screenshot-1.png
          50 kB
        7. screenshot-2.png
          screenshot-2.png
          38 kB

            tats-u tats-u
            tats-u tats-u
            Mikel Martín Corrales Mikel Martín Corrales
            Jun Pataleta Jun Pataleta
            Mihail Geshoski Mihail Geshoski
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 48 minutes
                1d 3h 48m

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