[Rt-commit] rt branch, 4.0/loc-escape-squares, updated. rt-4.0.4-157-g842a114

? sunnavy sunnavy at bestpractical.com
Sat Jun 30 07:02:16 EDT 2012


The branch, 4.0/loc-escape-squares has been updated
       via  842a114c128f35f0b65ee7d9f7a91d3ea27e23b2 (commit)
       via  1920b6488b5fa1b91c95f7d093310f98917e3360 (commit)
      from  3754c0ac4eaa97cecad534964d7952829ae3a490 (commit)

Summary of changes:
 lib/RT/CurrentUser.pm |    4 +++-
 share/po/en.po        |   16 ----------------
 2 files changed, 3 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit 1920b6488b5fa1b91c95f7d093310f98917e3360
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jun 30 18:49:00 2012 +0800

    Revert "we return the string directly if it's not in .po"
    
    This reverts commit 40efce541e1ce822b23b647c21a13a6def20bb92.
    
    instead, we can return the unescaped string in this case

diff --git a/share/po/en.po b/share/po/en.po
index d8704b6..ac9a71b 100644
--- a/share/po/en.po
+++ b/share/po/en.po
@@ -21,19 +21,3 @@ msgstr "Home"
 msgid "Residence"
 msgstr "Home"
 
-#: share/html/Elements/RT__CustomField/ColumnMap:166
-msgid "[Down]"
-msgstr "[Down]"
-
-#: share/html/Elements/RT__CustomField/ColumnMap:163
-msgid "[Up]"
-msgstr "[Up]"
-
-#: NOT FOUND IN SOURCE
-msgid "[no subject]"
-msgstr "[no subject]"
-
-#: share/html/Search/Elements/EditSort:61
-msgid "[none]"
-msgstr "[none]"
-

commit 842a114c128f35f0b65ee7d9f7a91d3ea27e23b2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jun 30 18:50:22 2012 +0800

    return the unescaped string if it's not in .po
    
    this fixes the bug that returns "~[Up~]" instead of the right "[Up]"

diff --git a/lib/RT/CurrentUser.pm b/lib/RT/CurrentUser.pm
index 57ee1eb..34906a5 100644
--- a/lib/RT/CurrentUser.pm
+++ b/lib/RT/CurrentUser.pm
@@ -242,7 +242,9 @@ sub loc {
     if (@_ == 1) {
         # pre-scan the lexicon hashes to return _AUTO keys verbatim,
         # to keep locstrings containing '[' and '~' from tripping over Maketext
-        return $_[0] unless grep exists $_->{$_[0]}, @{ $handle->_lex_refs };
+        my $unescaped = $_[0];
+        $unescaped =~ s!~(.)!$1!g;
+        return $unescaped unless grep exists $_->{$_[0]}, @{ $handle->_lex_refs };
     }
 
     return $handle->maketext(@_);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list