Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try to localize the empty string

  • Loading branch information...
commit a49623fb43ece5f35c82900d2d32de051b301c44 1 parent 0b921de
@petdance authored
Showing with 6 additions and 1 deletion.
  1. +1 −0  crank.pl
  2. +5 −1 t/html.t
View
1  crank.pl
@@ -60,6 +60,7 @@
my ($context, $arg) = @_;
return sub {
my ($key) = @_;
+ return '' if $key eq '';
my $value = __x(encode('UTF-8', $key), currlang => $arg);
return decode 'UTF-8', $value;
};
View
6 t/html.t
@@ -17,10 +17,14 @@ no warnings 'redefine';
$HTML::Lint::HTML4::isKnownAttribute{a}{'xml:lang'} = 1;
my @files = (glob( 'build/*.html' ), glob ( 'build/*/*.html' ));
-plan( tests => scalar @files );
+plan( tests => 2 * @files );
for my $filename ( @files ) {
my $text = decode_utf8(read_file( $filename ));
html_ok( $text, $filename );
+
+ # We had a problem where crank.pl was localizing empty strings, which translates to details about localization.
+ # This test makes sure that it doesn't happen.
+ unlike( $text, qr/POT-Creation-Date/, 'Localization stuff should not leak into HTML' );
}
Please sign in to comment.
Something went wrong with that request. Please try again.