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

Enable the welcome message language strings to be customised

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_400_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-72658-master-welcometosite
    • Testing Instructions:
      Hide
      1. Use the language customisation tool and customise the string "welcomeback" from the moodle.php (core) component. Alternatively, you can directly edit the file moodledata/lang/en_local/moodle.php and then purge lang caches, or have CFG->langstringcache set to 0.
      2. Log in to the site.
      3. TEST: Check that you see the message "Welcome back, ..." matching your customised string.
      4. As admin create a new user in the site.
      5. Using the same technique than in step #1, now edit the "welcometosite" string.
      6. Log in the site as the new user just created.
      7. TEST: Check that you see the message "Welcome, ..." matching your customised string.
        Examples of supported placeholder values:

      $string['welcomeback'] = 'Welcome back, {$a->firstname}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->lastname}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->alternatename}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->middlename}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->lastnamephonetic}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->firstnamephonetic}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->fullname}! 👋';
      $string['welcomeback'] = 'Welcome back, {$a->alternativefullname}! 👋';
      

      Show
      Use the language customisation tool and customise the string "welcomeback" from the moodle.php (core) component. Alternatively, you can directly edit the file moodledata/lang/en_local/moodle.php and then purge lang caches, or have CFG->langstringcache set to 0. Log in to the site. TEST: Check that you see the message "Welcome back, ..." matching your customised string. As admin create a new user in the site. Using the same technique than in step #1, now edit the "welcometosite" string. Log in the site as the new user just created. TEST: Check that you see the message "Welcome, ..." matching your customised string. Examples of supported placeholder values: $string['welcomeback'] = 'Welcome back, {$a->firstname}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->lastname}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->alternatename}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->middlename}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->lastnamephonetic}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->firstnamephonetic}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->fullname}! 👋'; $string['welcomeback'] = 'Welcome back, {$a->alternativefullname}! 👋';
    • Story Points:
      0
    • Sprint:
      HQ Team International Sprin 10

      Description

      The new lang strings welcometosite and welcomeback introduced in MDL-71964 use the user's first name.

      As some cultures may want the full name or last name to be used, rather than the first name, let's enable sites to easily customise the strings by replacing {$a} with {$a->firstname} and have lastname and alternatename placeholders available in the code.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mudrd8mz David Mudrák (@mudrd8mz)
              Reporter:
              tsala Helen Foster
              Peer reviewer:
              Víctor Déniz Falcón Víctor Déniz Falcón
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón, Huong Nguyen, Bas Brands, Mathew May
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 46 minutes
                  1h 46m