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);

        Issue Links

          Activity

          Hide
          fredsa fredsa [X] (Inactive) added a comment -

          I believe that https://github.com/phpbb/phpbb3/commit/67b243cfc53e3f5f8bf6cd2a5eb80df475a6dd4c works and eliminates the use of the preg_replace() /e modifier (http://php.net/manual/en/reference.pcre.pattern.modifiers.php)

          Given that the original reporter hasn't looked at the issue since 2010, is there another way we can mark the issue as 'verified' and get the commit pulled into a release branch?

          Show
          fredsa fredsa [X] (Inactive) added a comment - I believe that https://github.com/phpbb/phpbb3/commit/67b243cfc53e3f5f8bf6cd2a5eb80df475a6dd4c works and eliminates the use of the preg_replace() /e modifier ( http://php.net/manual/en/reference.pcre.pattern.modifiers.php ) Given that the original reporter hasn't looked at the issue since 2010, is there another way we can mark the issue as 'verified' and get the commit pulled into a release branch?
          Hide
          bantu Andreas Fischer added a comment -

          fredsa: A fix for this ticket has been merged and this ticket is resolved. The commit you're referring to is already in the phpBB repository. "Unverified Fix" means that nobody confirmed (double checked) the ticket to be fixed.

          Show
          bantu Andreas Fischer added a comment - fredsa: A fix for this ticket has been merged and this ticket is resolved. The commit you're referring to is already in the phpBB repository. "Unverified Fix" means that nobody confirmed (double checked) the ticket to be fixed.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development