Skip to content

Commit

Permalink
Item12285: Revert More robust fix for MAKETEXT"
Browse files Browse the repository at this point in the history
This partially  reverts commit 68bbfc9dd42bf0627b09c2646b7078beffdd4808

Ghanges here also change the strings that are looked up.  We need
something different but this probably isn't it.

git-svn-id: http://svn.foswiki.org/trunk@16242 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Dec 19, 2012
1 parent e6bc846 commit c01f5fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/lib/Foswiki/Macros/MAKETEXT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ package Foswiki;
use strict;
use warnings;

my $TT1 = chr(1);
use Locale::Maketext;
my $escape =
( $Foswiki::cfg{UserInterfaceInternationalisation}
&& $Locale::Maketext::VERSION
&& $Locale::Maketext::VERSION < 1.23 );

sub MAKETEXT {
my ( $this, $params ) = @_;
Expand Down Expand Up @@ -33,8 +37,8 @@ s/~\[(\*,\_(\d+),[^,]+(,([^,]+))?)~\]/ _validate($1, $2, $max, $min, $param_erro
# get the args to be interpolated.
my $argsStr = $params->{args} || "";

# Remove any escapes.
$str =~ s#\\#<$TT1>#g;
# Escape any escapes.
$str =~ s#\\#\\\\#g if ($escape); # escape any escapes

my @args = split( /\s*,\s*/, $argsStr );

Expand All @@ -46,9 +50,6 @@ s/~\[(\*,\_(\d+),[^,]+(,([^,]+))?)~\]/ _validate($1, $2, $max, $min, $param_erro
# do the magic:
my $result = $this->i18n->maketext( $str, @args );

# Restore the escapes.
$result =~ s#<$TT1>#\\#g;

# replace accesskeys:
$result =~
s#(^|[^&])&([a-zA-Z])#$1<span class='foswikiAccessKey'>$2</span>#g;
Expand Down

0 comments on commit c01f5fd

Please sign in to comment.