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

Enable the welcome message language strings to be customised

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-72658-master-welcometosite
    • 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}! 👋';
    • 0
    • HQ Team International Sprin 10

      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.

        1. screenshot-1.png
          31 kB
          David Mudrák (@mudrd8mz)
        2. MDL-72658_Test Passed.png
          111 kB
          Gladys Basiana

            mudrd8mz David Mudrák (@mudrd8mz)
            tsala Helen Foster
            Victor Déniz Falcón Victor Déniz Falcón
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Gladys Basiana Gladys Basiana
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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