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

Adjust the implementation of error messages localization

    XMLWordPrintable

Details

    • Task
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.0-dev
    • 3.1.0-a1
    • Other
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: