summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-17 11:35:21 +0200
committerYorhel <git@yorhel.nl>2009-08-17 16:27:16 +0200
commitf85607dd19757fb77546f05fdd53d408216f1623 (patch)
tree885a01cb4261d56cd7a526d5a6db058069df3036
parentdc2a9de7c0e519eb3a930f0b38ebe26861b2752e (diff)
L10N: Converted htmlEditMessage, htmlItemMessage and htmlSearchBox
This finishes Util::CommonHTML, with the exception of htmlVoteStats
-rw-r--r--data/lang.txt89
-rw-r--r--lib/VNDB/Handler/Producers.pm5
-rw-r--r--lib/VNDB/Handler/Releases.pm5
-rw-r--r--lib/VNDB/Handler/VNEdit.pm5
-rw-r--r--lib/VNDB/L10N.pm6
-rw-r--r--lib/VNDB/Util/CommonHTML.pm46
6 files changed, 124 insertions, 32 deletions
diff --git a/data/lang.txt b/data/lang.txt
index 8fe132bd..8b604104 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -263,7 +263,7 @@ ru*:
## Main website layout ##
#############################################################################
# Util::LayoutHTML
-# Util::CommonHTML::htmlMainTabs, htmlBrowseNavigate, htmlRevision
+# Util::CommonHTML::htmlMainTabs, htmlBrowseNavigate, htmlRevision, htmlSearchBox
# Main title of the site, used on header of each page and as title on the homepage
@@ -529,6 +529,34 @@ en : ~[empty~]
ru*:
+# tabs above the search boxes
+
+:_searchbox_vn
+en : Visual novels
+ru*:
+
+:_searchbox_releases
+en : Releases
+ru*:
+
+:_searchbox_producers
+en : Producers
+ru*:
+
+:_searchbox_tags
+en : Tags
+ru*:
+
+:_searchbox_users
+en : Users
+ru*:
+
+# text on the search button
+:_searchbox_submit
+en : Search!
+ru*:
+
+
#############################################################################
@@ -676,7 +704,8 @@ ru*:
#############################################################################
## Misc. messages ##
#############################################################################
-# Util::CommonHTML::htmlDenied and htmlHiddenMessage
+# Util::CommonHTML::htmlDenied,
+# htmlHiddenMessage, htmlEditMessage and htmlItemMessage
# Generic "Access denied!" page
@@ -717,3 +746,59 @@ en : This item has been deleted from the database, File a request on the
<a href="[_1]">discussion board</a> to undelete this page.
ru*:
+
+# The warning/notice messages on edit pages
+
+:_editmsg_copy_title
+en : You're not editing a release!
+ru*:
+
+:_editmsg_copy_msg
+en : You're about to insert a new release into the database with information based on [_1].<br />
+ Hit the 'edit' tab on the right-top if you intended to edit the release instead of creating a new one.
+ru*:
+
+:_editmsg_msg_title
+en : Before editing:
+ru*:
+
+:_editmsg_msg_guidelines
+en : Read the <a href="[_1]">guidelines</a>!
+ru*:
+
+:_editmsg_msg_discuss
+en : Check for any existing discussions on the <a href="[_1]">discussion board</a>
+ru*:
+
+:_editmsg_msg_history
+en : Browse the <a href="[_1]">edit history</a> for any recent changes related to what you want to change.
+ru*:
+
+:_editmsg_msg_search
+en : <a href="[_1]">Search the database</a> to see if we already have information about this [index,_2,visual novel,release,producer].
+ru*:
+
+:_editmsg_revert_title
+en : Reverting
+ru*:
+
+:_editmsg_revert_msg
+en : You are editing an old revision of this [index,_1,visual novel,release,producer].
+ If you save it, all changes made after this revision will be reverted!
+ru*:
+
+
+# Messages about editing on the VN/Release/Producer pages (right beneath the tabs)
+
+:_itemmsg_locked
+en : Locked for editing
+ru*:
+
+:_itemmsg_login
+en : You need to be <a href="[_1]>logged in</a> to edit this page
+ru*:
+
+:_itemmsg_denied
+en : You are not allowed to edit this page
+ru*:
+
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 43b7c025..cc7e1324 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -129,9 +129,10 @@ sub edit {
$frm->{lang} = 'ja' if !$pid && !defined $frm->{lang};
$frm->{editsum} = sprintf 'Reverted to revision p%d.%d', $pid, $rev if $rev && !defined $frm->{editsum};
- $self->htmlHeader(title => $pid ? 'Edit '.$p->{name} : 'Add new producer', noindex => 1);
+ my $title = $pid ? 'Edit '.$p->{name} : 'Add new producer';
+ $self->htmlHeader(title => $title, noindex => 1);
$self->htmlMainTabs('p', $p, 'edit') if $pid;
- $self->htmlEditMessage('p', $p);
+ $self->htmlEditMessage('p', $p, $title);
$self->htmlForm({ frm => $frm, action => $pid ? "/p$pid/edit" : '/p/new', editsum => 1 }, "General info" => [
[ select => name => 'Type', short => 'type',
options => [ map [ $_, mt "_ptype_$_" ], sort @{$self->{producer_types}} ] ],
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 61889459..51715e72 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -366,10 +366,11 @@ sub edit {
$frm->{title} = $v->{title} if !defined $frm->{title} && !$r;
$frm->{original} = $v->{original} if !defined $frm->{original} && !$r;
- $self->htmlHeader(js => 'forms', title => $rid ? ''.($copy ? 'Copy ':'Edit ').$r->{title} : 'Add release to '.$v->{title}, noindex => 1);
+ my $title = $rid ? ''.($copy ? 'Copy ':'Edit ').$r->{title} : 'Add release to '.$v->{title};
+ $self->htmlHeader(js => 'forms', title => $title, noindex => 1);
$self->htmlMainTabs('r', $r, $copy ? 'copy' : 'edit') if $rid;
$self->htmlMainTabs('v', $v, 'edit') if $vid;
- $self->htmlEditMessage('r', $r, $copy);
+ $self->htmlEditMessage('r', $r, $title, $copy);
_form($self, $r, $v, $frm, $copy);
$self->htmlFooter;
}
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 613cec46..9ab3862d 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -95,9 +95,10 @@ sub edit {
!exists $frm->{$_} && ($frm->{$_} = $b4{$_}) for (keys %b4);
$frm->{editsum} = sprintf 'Reverted to revision v%d.%d', $vid, $rev if $rev && !defined $frm->{editsum};
- $self->htmlHeader(js => 'forms', title => $vid ? "Edit $v->{title}" : 'Add a new visual novel', noindex => 1);
+ my $title = $vid ? "Edit $v->{title}" : 'Add a new visual novel';
+ $self->htmlHeader(js => 'forms', title => $title, noindex => 1);
$self->htmlMainTabs('v', $v, 'edit') if $vid;
- $self->htmlEditMessage('v', $v);
+ $self->htmlEditMessage('v', $v, $title);
_form($self, $v, $frm);
$self->htmlFooter;
}
diff --git a/lib/VNDB/L10N.pm b/lib/VNDB/L10N.pm
index 3dfe00c6..c8b87711 100644
--- a/lib/VNDB/L10N.pm
+++ b/lib/VNDB/L10N.pm
@@ -148,6 +148,12 @@ use warnings;
my($id,$n) = ref($_[0])eq'HASH'?($_[0]{uid}||$_[0]{requester}, $_[0]{username}):@_;
return !$id ? '[deleted]' : '<a href="/u'.$id.'">'.$n.'</a>';
}
+
+ # Arguments: index, @list. returns $list[index]
+ sub index {
+ shift;
+ return $_[shift];
+ }
}
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index a88988f0..d44669e2 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -277,7 +277,7 @@ sub htmlRevision {
div;
revheader($self, $type, $new);
br;
- b mt '_revision_summary';
+ b mt '_revision_new_summary';
br; br;
lit bb2html($new->{comments})||'-';
end;
@@ -365,38 +365,36 @@ sub revdiff {
# Generates a generic message to show as the header of the edit forms
# Arguments: v/r/p, obj
sub htmlEditMessage {
- my($self, $type, $obj, $copy) = @_;
- my $full = {v => 'visual novel', r => 'release', p => 'producer'}->{$type};
+ my($self, $type, $obj, $title, $copy) = @_;
+ my $num = {v => 0, r => 1, p => 2}->{$type};
my $guidelines = {v => 2, r => 3, p => 4}->{$type};
div class => 'mainbox';
- h1 $obj ? ''.($copy ? 'Copy ':'Edit ').($obj->{name}||$obj->{title}) : "Add new $full";
+ h1 $title;
if($copy) {
div class => 'warning';
- h2 "You're not editing a release!";
+ h2 mt '_editmsg_copy_title';
p;
- txt "You're about to insert a new release into the database with information based on ";
- a href => "/$type$obj->{id}", $obj->{title};
- txt ". Hit the 'edit' tab on the right-top if you intended to edit the release instead of creating a new one.";
+ lit mt '_editmsg_copy_msg', sprintf '<a href="/%s%d">%s</a>', $type, $obj->{id}, xml_escape $obj->{title},
end;
end;
}
div class => 'notice';
- h2 'Before editing:';
+ h2 mt '_editmsg_msg_title';
ul;
- li; lit qq|Read the <a href="/d$guidelines">guidelines</a>!|; end;
+ li; lit mt '_editmsg_msg_guidelines', "/d$guidelines"; end;
if($obj) {
- li; lit qq|Check for any existing discussions on the <a href="/t/$type$obj->{id}">discussion board</a>|; end;
- li; lit qq|Browse the <a href="/$type$obj->{id}/hist">edit history</a> for any recent changes related to what you want to change.|; end;
+ li; lit mt '_editmsg_msg_discuss', $type eq 'r' ? "/t/v$obj->{vn}[0]{vid}" : "/t/$type$obj->{id}"; end;
+ li; lit mt '_editmsg_msg_history', "/$type$obj->{id}/hist"; end;
} elsif($type ne 'r') {
- li; lit qq|<a href="/$type/all">Search the database</a> to see if we already have information about this $full|; end;
+ li; lit mt '_editmsg_msg_search', "/$type/all", $num; end;
}
end;
end;
if($obj && $obj->{latest} != $obj->{cid}) {
div class => 'warning';
- h2 'Reverting';
- p qq|You are editing an old revision of this $full. If you save it, all changes made after this revision will be reverted!|;
+ h2 mt '_editmsg_revert_title';
+ p mt '_editmsg_revert_msg', $num;
end;
}
end;
@@ -410,13 +408,13 @@ sub htmlItemMessage {
my($self, $type, $obj) = @_;
if($obj->{locked}) {
- p class => 'locked', 'Locked for editing'
+ p class => 'locked', mt '_itemmsg_locked';
} elsif(!$self->authInfo->{id}) {
p class => 'locked';
- lit 'You need to be <a href="/u/login">logged in</a> to edit this page';
+ lit mt '_itemmsg_login', '/u/login';
end;
} elsif(!$self->authCan('edit')) {
- p class => 'locked', "You're not allowed to edit this page";
+ p class => 'locked', mt '_itemmsg_denied';
}
}
@@ -542,14 +540,14 @@ sub htmlSearchBox {
fieldset class => 'search';
p class => 'searchtabs';
- a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), 'Visual novels';
- a href => '/r', $sel eq 'r' ? (class => 'sel') : (), 'Releases';
- a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), 'Producers';
- a href => '/g', $sel eq 'g' ? (class => 'sel') : (), 'Tags';
- a href => '/u/all', $sel eq 'u' ? (class => 'sel') : (), 'Users';
+ a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), mt '_searchbox_vn';
+ a href => '/r', $sel eq 'r' ? (class => 'sel') : (), mt '_searchbox_releases';
+ a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), mt '_searchbox_producers';
+ a href => '/g', $sel eq 'g' ? (class => 'sel') : (), mt '_searchbox_tags';
+ a href => '/u/all', $sel eq 'u' ? (class => 'sel') : (), mt '_searchbox_users';
end;
input type => 'text', name => 'q', id => 'q', class => 'text', value => $v;
- input type => 'submit', class => 'submit', value => 'Search!';
+ input type => 'submit', class => 'submit', value => mt '_searchbox_submit';
end;
}