summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-17 14:18:02 +0200
committerYorhel <git@yorhel.nl>2009-08-17 16:27:17 +0200
commit4319d644d0056134ab4b397f5d2cf365c1e3bb1f (patch)
tree800e7b555b0eebb20af8eab8ce51c6dd3e7dd411
parent797b71b677b4c7a348a184eaa8d9faf1b241942d (diff)
L10N: Converted two homepage items and use key for site title
-rw-r--r--data/lang.txt11
-rw-r--r--lib/VNDB/Handler/Misc.pm24
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm2
3 files changed, 22 insertions, 15 deletions
diff --git a/data/lang.txt b/data/lang.txt
index 7432243c..5e2e6a3a 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -325,7 +325,8 @@ ru*:
# Main title of the site, used on header of each page and as title on the homepage
-:The Visual Novel Database
+:_site_title
+en : The Visual Novel Database
ru : База Данных Интерактивных Новелл
@@ -638,6 +639,10 @@ ru*:
en : Recent Changes
ru*:
+:_home_recentchanges_item
+en : [_1]:[_2] by [userstr,_3]
+ru*:
+
:_home_announcements
en : Announcements
ru*:
@@ -650,6 +655,10 @@ ru*:
en : Recent Posts
ru*:
+:_home_recentposts_item
+en : [age,_1] [_2] by [userstr,_3]
+ru*:
+
:_home_randomvn
en : Random vsual novels
ru*:
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;