[Jifty-commit] r2660 - in jifty/branches/template-declare: .
t/TestApp/lib/TestApp t/TestApp/t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat Jan 27 05:50:10 EST 2007
Author: jesse
Date: Sat Jan 27 05:50:09 2007
New Revision: 2660
Added:
jifty/branches/template-declare/t/TestApp/lib/TestApp/View.pm
Modified:
jifty/branches/template-declare/ (props changed)
jifty/branches/template-declare/lib/Jifty/I18N.pm
jifty/branches/template-declare/t/TestApp/t/i18n-standalone.t
Log:
r21551 at hualien: jesse | 2007-01-27 18:25:41 +0800
* failing tests for i18n on the template declare branch
r21557 at hualien: jesse | 2007-01-27 18:31:38 +0800
* to go with the failing tests
Modified: jifty/branches/template-declare/lib/Jifty/I18N.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/I18N.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/I18N.pm Sat Jan 27 05:50:09 2007
@@ -63,6 +63,7 @@
$lang = [defined $lang ? $lang : ()] unless ref($lang) eq 'ARRAY';
my $lh = $class->get_handle(@$lang);
+
$DynamicLH = \$lh unless @$lang;
$self->init;
@@ -80,6 +81,7 @@
my @stringified_args = map {"$_"} @_;
my $result = eval { $lh->maketext(@stringified_args) };
if ($@) {
+ warn $@;
# Sometimes Locale::Maketext fails to localize a string and throws
# an exception instead. In that case, we just return the input.
return join(' ', @stringified_args);
Added: jifty/branches/template-declare/t/TestApp/lib/TestApp/View.pm
==============================================================================
--- (empty file)
+++ jifty/branches/template-declare/t/TestApp/lib/TestApp/View.pm Sat Jan 27 05:50:09 2007
@@ -0,0 +1,15 @@
+package TestApp::View;
+use warnings;
+use strict;
+
+use Jifty::View::Declare -base;
+
+template 'concrete2.html' => sub {
+ html {
+ body {
+ h1 { _( 'I have %1 concrete mixers', 2) };
+ }
+ }
+};
+
+1;
Modified: jifty/branches/template-declare/t/TestApp/t/i18n-standalone.t
==============================================================================
--- jifty/branches/template-declare/t/TestApp/t/i18n-standalone.t (original)
+++ jifty/branches/template-declare/t/TestApp/t/i18n-standalone.t Sat Jan 27 05:50:09 2007
@@ -5,7 +5,7 @@
use lib 't/lib';
use Jifty::SubTest;
-use Jifty::Test tests => 16;
+use Jifty::Test tests => 20;
use Jifty::Test::WWW::Mechanize;
use Net::HTTP;
use URI;
@@ -32,6 +32,10 @@
ok $res->is_success, "can access concrete";
like $res->content, qr/2 concrete mixers/, 'en works for an unknown string';
+$res = $ua->get("$base/concrete2.html");
+ok $res->is_success, "can access concrete";
+like $res->content, qr/2 concrete mixers/, 'en works for an unknown string';
+
$ua->default_header('Accept-Language' => "ja");
$res = $ua->get("$base/__jifty/admin/");
ok $res->is_success, "can access admin console";
@@ -41,6 +45,10 @@
ok $res->is_success, "can access concrete";
like $res->content, qr/2 concrete mixers/, 'ja works for an unknown string';
+$res = $ua->get("$base/concrete2.html");
+ok $res->is_success, "can access concrete";
+like $res->content, qr/2 concrete mixers/, 'en works for an unknown string';
+
$ua->default_header('Accept-Language' => "fr");
$res = $ua->get("$base/__jifty/admin/");
ok $res->is_success, "can access admin console";
More information about the Jifty-commit
mailing list