summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/lang.txt34
-rw-r--r--data/script.js14
-rw-r--r--lib/VNDB/Handler/VNEdit.pm7
-rwxr-xr-xutil/jsgen.pl3
4 files changed, 46 insertions, 12 deletions
diff --git a/data/lang.txt b/data/lang.txt
index 3437455c..8c712a5a 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -3076,6 +3076,40 @@ ru : Выбранные связи
en : Add relation
ru : Добавить связь
+# <title1> is a <relation> of <title2>
+# this trick doesn't even work very well in English, so just an approximation is fine
+:_vnedit_rel_isa
+en : is a
+ru*:
+
+:_vnedit_rel_of
+en : of
+ru*:
+
+:_vnedit_rel_addbut
+en : add
+ru*:
+
+:_vnedit_rel_del
+en : del
+ru*:
+
+:_vnedit_rel_none
+en : No relations selected.
+ru*:
+
+:_vnedit_rel_findformat
+en : Visual novel textbox must start with an ID (e.g. v17)
+ru*:
+
+:_vnedit_rel_novn
+en : Visual novel not found!
+ru*:
+
+:_vnedit_rel_double
+en : This visual novel has already been selected!
+ru*:
+
:_vnedit_scr
en : Screenshots
ru : Скриншоты
diff --git a/data/script.js b/data/script.js
index 2ddadb49..9bb3d84a 100644
--- a/data/script.js
+++ b/data/script.js
@@ -754,9 +754,9 @@ function vnrAdd(rel, vid, title) {
byId('relation_tbl').appendChild(tag('tr', {id:'relation_tr_'+vid},
tag('td', {'class':'tc_vn' }, 'v'+vid+':', tag('a', {href:'/v'+vid}, shorten(title, 40))),
- tag('td', {'class':'tc_rel' }, 'is a ', sel, ' of'),
+ tag('td', {'class':'tc_rel' }, mt('_vnedit_rel_isa')+' ', sel, ' '+mt('_vnedit_rel_of')),
tag('td', {'class':'tc_title'}, shorten(byId('title').value, 40)),
- tag('td', {'class':'tc_add' }, tag('a', {href:'#', onclick:vnrDel}, 'del'))
+ tag('td', {'class':'tc_add' }, tag('a', {href:'#', onclick:vnrDel}, mt('_vnedit_rel_del')))
));
vnrEmpty();
@@ -765,7 +765,7 @@ function vnrAdd(rel, vid, title) {
function vnrEmpty() {
var tbl = byId('relation_tbl');
if(byName(tbl, 'tr').length < 1)
- tbl.appendChild(tag('tr', {id:'relation_tr_none'}, tag('td', {colspan:4}, 'No relations selected.')));
+ tbl.appendChild(tag('tr', {id:'relation_tr_none'}, tag('td', {colspan:4}, mt('_vnedit_rel_none'))));
else if(byId('relation_tr_none'))
tbl.removeChild(byId('relation_tr_none'));
}
@@ -804,7 +804,7 @@ function vnrFormAdd() {
var input = txt.value;
if(!input.match(/^v[0-9]+/)) {
- alert('Visual novel textbox must start with an ID (e.g. v17)');
+ alert('_vnedit_rel_findformat');
return false;
}
@@ -815,15 +815,15 @@ function vnrFormAdd() {
ajax('/xml/vn.xml?q='+encodeURIComponent(input), function(hr) {
txt.disabled = sel.disabled = false;
txt.value = '';
- setText(lnk, 'add');
+ setText(lnk, mt('_vnedit_rel_addbut'));
var items = hr.responseXML.getElementsByTagName('item');
if(items.length < 1)
- return alert('Visual novel not found!');
+ return alert(mt('_vnedit_rel_novn'));
var id = items[0].getAttribute('id');
if(byId('relation_tr_'+id))
- return alert('This visual novel has already been selected!');
+ return alert(mt('_vnedit_rel_double'));
vnrAdd(sel.selectedIndex, id, items[0].firstChild.nodeValue);
sel.selectedIndex = 0;
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 8430156d..75cc9002 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -193,23 +193,22 @@ sub _form {
end;
h2 mt '_vnedit_rel_add';
- # TODO: localize JS relartion selector
table;
Tr id => 'relation_new';
td class => 'tc_vn';
input type => 'text', class => 'text';
end;
td class => 'tc_rel';
- txt ' is a ';
+ txt mt('_vnedit_rel_isa').' ';
Select;
option value => $_, mt "_vnrel_$_"
for (sort { $self->{vn_relations}{$a}[0] <=> $self->{vn_relations}{$b}[0] } keys %{$self->{vn_relations}});
end;
- txt ' of';
+ txt ' '.mt '_vnedit_rel_of';
end;
td class => 'tc_title', $v ? $v->{title} : '';
td class => 'tc_add';
- a href => '#', 'add';
+ a href => '#', mt '_vnedit_rel_addbut';
end;
end;
end;
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 3afb371a..4ab856e5 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -26,7 +26,8 @@ my $jskeys = qr{^(?:
_js_.+|
_menu_emptysearch|
_vnpage_uopt_(?:10?vote|rel.+)|
- _rlst_[vr]stat_.+
+ _rlst_[vr]stat_.+|
+ _vnedit_rel_(?:isa|of|addbut|del|none|findformat|novn|double)
)$}x;
sub l10n {