Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9867

Adjust the implementation of error messages localization

    Details

    • Type: Task
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-dev
    • Fix Version/s: 3.1.0-a1
    • Component/s: Other
    • Labels:
      None

      Description

      We use the trick to localize error messages similar to

      // Replace "error" strings with their real, localised form
      $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
      

      in the following files:
      acp_users.php - for 5 times;
      ucp_prefs.php - for 2 times;
      ucp_profile.php - for 4 times;
      ucp_register.php - for 1 time.

      After the IRC discussion the better implementation seems to be using the scheme

      // Replace "error" strings with their real, localised form
      $error = array_map(array($user, 'lang'), $error);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rxu rxu
                Reporter:
                rxu rxu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: