summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-17 11:32:03 +0100
committerYorhel <git@yorhel.nl>2016-01-17 11:39:53 +0100
commit38a4c36b21b1979a64cb915a80167fb7f8cadb9e (patch)
tree80f8c4fe110ddffa8a1aaf8d80e774544d38a533 /lib/VNDB/Handler
parentb14f137dc5613472eb68ffea2bb76abc3f7172b6 (diff)
L10N: Intern VN/producer relations + update relation graphs
Now that graphviz knows the actual strings, it has a better opportunity to create better graphs. (Most of them still look messy tho)
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r--lib/VNDB/Handler/Producers.pm10
-rw-r--r--lib/VNDB/Handler/VNEdit.pm2
-rw-r--r--lib/VNDB/Handler/VNPage.pm6
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index cf534b3e..29c68d2d 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -27,10 +27,6 @@ sub rg {
return if $self->htmlRGHeader($title, 'p', $p);
$p->{svg} =~ s/id="node_p$pid"/id="graph_current"/;
- # TODO: These strings can be properly interned in the SVG now
- $p->{svg} =~ s/\$___(_prodrel_[a-z]+)____\$/mt $1/eg;
- $p->{svg} =~ s/\$_lang_([a-z-]+)_\$/$self->{languages}{$1}/eg;
- $p->{svg} =~ s/\$_ptype_([a-z]+)_\$/$self->{producer_types}{$1}/eg;
div class => 'mainbox';
h1 $title;
@@ -72,7 +68,7 @@ sub page {
[ desc => diff => qr/[ ,\n\.]/ ],
[ relations => join => '<br />', split => sub {
my @r = map sprintf('%s: <a href="/p%d" title="%s">%s</a>',
- mt("_prodrel_$_->{relation}"), $_->{id}, xml_escape($_->{original}||$_->{name}), xml_escape shorten $_->{name}, 40
+ $self->{prod_relations}{$_->{relation}}[2], $_->{id}, xml_escape($_->{original}||$_->{name}), xml_escape shorten $_->{name}, 40
), sort { $a->{id} <=> $b->{id} } @{$_[0]};
return @r ? @r : (mt '_revision_empty');
}],
@@ -105,7 +101,7 @@ sub page {
p class => 'center';
br;
for my $r (sort { $self->{prod_relations}{$a}[0] <=> $self->{prod_relations}{$b}[0] } keys %rel) {
- txt mt("_prodrel_$r").': ';
+ txt $self->{prod_relations}{$r}[2].': ';
for (@{$rel{$r}}) {
a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 40;
txt ', ' if $_ ne $rel{$r}[$#{$rel{$r}}];
@@ -301,7 +297,7 @@ sub edit {
end;
td class => 'tc_rel';
Select;
- option value => $_, mt "_prodrel_$_"
+ option value => $_, $self->{prod_relations}{$_}[2]
for (sort { $self->{prod_relations}{$a}[0] <=> $self->{prod_relations}{$b}[0] } keys %{$self->{prod_relations}});
end;
end;
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 3d7b9db4..854bbf46 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -379,7 +379,7 @@ sub _form {
input type => 'checkbox', id => 'official', checked => 'checked';
label for => 'official', mt '_vnedit_rel_official';
Select;
- option value => $_, mt "_vnrel_$_"
+ option value => $_, $self->{vn_relations}{$_}[2]
for (sort { $self->{vn_relations}{$a}[0] <=> $self->{vn_relations}{$b}[0] } keys %{$self->{vn_relations}});
end;
txt ' '.mt '_vnedit_rel_of';
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index c5635f1d..50f21071 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -33,8 +33,6 @@ sub rg {
return if $self->htmlRGHeader($title, 'v', $v);
$v->{svg} =~ s/id="node_v$vid"/id="graph_current"/;
- # TODO: The relation string can be properly interned in the SVG now
- $v->{svg} =~ s/\$___(_vnrel_[a-z]+)____\$/mt $1/eg;
div class => 'mainbox';
h1 $title;
@@ -534,7 +532,7 @@ sub _revision {
[ relations => join => '<br />', split => sub {
my @r = map sprintf('[%s] %s: <a href="/v%d" title="%s">%s</a>',
mt($_->{official} ? '_vndiff_rel_official' : '_vndiff_rel_unofficial'),
- mt("_vnrel_$_->{relation}"), $_->{id}, xml_escape($_->{original}||$_->{title}), xml_escape shorten $_->{title}, 40
+ $self->{vn_relations}{$_->{relation}}[2], $_->{id}, xml_escape($_->{original}||$_->{title}), xml_escape shorten $_->{title}, 40
), sort { $a->{id} <=> $b->{id} } @{$_[0]};
return @r ? @r : (mt '_revision_empty');
}],
@@ -617,7 +615,7 @@ sub _relations {
td class => 'relations';
dl;
for(sort keys %rel) {
- dt mt "_vnrel_$_";
+ dt $self->{vn_relations}{$_}[2];
dd;
for (@{$rel{$_}}) {
b class => 'grayedout', mt('_vnpage_relations_unofficial').' ' if !$_->{official};