#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
use RT::CurrentUser;
- # laod
+ # load
my $current_user = RT::CurrentUser->new;
$current_user->Load(...);
# or
my $handle = $self->LanguageHandle;
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 };
+ # If we have no [_1] replacements, and the key does not appear
+ # in the lexicon, unescape (using ~) and return it verbatim, as
+ # an optimization.
+ my $unescaped = $_[0];
+ $unescaped =~ s!~(.)!$1!g;
+ return $unescaped unless grep exists $_->{$_[0]}, @{ $handle->_lex_refs };
}
return $handle->maketext(@_);
my $self = shift;
return '' if !defined $_[0] || $_[0] eq '';
- # XXX: work around perl's deficiency when matching utf8 data
- return $_[0] if Encode::is_utf8($_[0]);
-
return $self->LanguageHandle->maketext_fuzzy( @_ );
}