diff options
author | Yorhel <git@yorhel.nl> | 2009-08-17 14:18:02 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-17 16:27:17 +0200 |
commit | 4319d644d0056134ab4b397f5d2cf365c1e3bb1f (patch) | |
tree | 800e7b555b0eebb20af8eab8ce51c6dd3e7dd411 /lib | |
parent | 797b71b677b4c7a348a184eaa8d9faf1b241942d (diff) |
L10N: Converted two homepage items and use key for site title
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 24 | ||||
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 2 |
2 files changed, 12 insertions, 14 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index a0949c92..fcb6afdf 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -4,7 +4,7 @@ package VNDB::Handler::Misc; use strict; use warnings; -use YAWF ':html', ':xml'; +use YAWF ':html', ':xml', 'xml_escape'; use VNDB::Func; @@ -36,10 +36,10 @@ YAWF::register( sub homepage { my $self = shift; - $self->htmlHeader(title => mt 'The Visual Novel Database'); + $self->htmlHeader(title => mt '_site_title'); div class => 'mainbox'; - h1 mt 'The Visual Novel Database'; + h1 mt '_site_title'; p class => 'description'; lit mt '_home_intro'; end; @@ -58,7 +58,6 @@ sub homepage { Tr; # Recent changes - # TODO: localized item format td; h1 mt '_home_recentchanges'; my $changes = $self->dbRevisionGet(what => 'item user', results => 10, auto => 1, hidden => 1); @@ -66,10 +65,10 @@ sub homepage { for (@$changes) { my $t = (qw|v r p|)[$_->{type}]; li; - b "$t:"; - a href => "/$t$_->{iid}.$_->{rev}", title => $_->{ioriginal}||$_->{ititle}, shorten $_->{ititle}, 30; - txt ' by '; - a href => "/u$_->{requester}", $_->{username}; + lit mt '_home_recentchanges_item', $t, + sprintf('<a href="%s" title="%s">%s</a>', "/$t$_->{iid}.$_->{rev}", + xml_escape($_->{ioriginal}||$_->{ititle}), xml_escape shorten $_->{ititle}, 33), + $_; end; } end; @@ -92,7 +91,6 @@ sub homepage { end; # Recent posts - # TODO: localized item format td; h1 mt '_home_recentposts'; my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, order => 'tpl.date DESC', notusers => 1); @@ -100,10 +98,10 @@ sub homepage { for (@$posts) { my $boards = join ', ', map $self->{discussion_boards}{$_->{type}}.($_->{iid}?' > '.$_->{title}:''), @{$_->{boards}}; li; - txt $self->{l10n}->age($_->{ldate}).' '; - a href => "/t$_->{id}.$_->{count}", title => "Posted in $boards", shorten $_->{title}, 20; - txt ' by '; - a href => "/u$_->{luid}", $_->{lusername}; + lit mt '_home_recentposts_item', $_->{ldate}, + sprintf('<a href="%s" title="%s">%s</a>', "/t$_->{id}.$_->{count}", + xml_escape("Posted in $boards"), xml_escape shorten $_->{title}, 25), + {uid => $_->{luid}, username => $_->{lusername}}; end; } end; diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index 8bc08a1f..774c2d09 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -38,7 +38,7 @@ sub htmlHeader { # %options->{ title, js, noindex, search } div id => 'bgright', ' '; div id => 'header'; h1; - a href => '/', lc mt 'The Visual Novel Database'; + a href => '/', lc mt '_site_title'; end; end; |