diff options
author | Yorhel <git@yorhel.nl> | 2016-01-17 11:32:03 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2016-01-17 11:39:53 +0100 |
commit | 38a4c36b21b1979a64cb915a80167fb7f8cadb9e (patch) | |
tree | 80f8c4fe110ddffa8a1aaf8d80e774544d38a533 /lib/VNDB/Handler/Producers.pm | |
parent | b14f137dc5613472eb68ffea2bb76abc3f7172b6 (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/Producers.pm')
-rw-r--r-- | lib/VNDB/Handler/Producers.pm | 10 |
1 files changed, 3 insertions, 7 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; |