summaryrefslogtreecommitdiff
path: root/lib/Multi
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/Multi
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/Multi')
-rw-r--r--lib/Multi/RG.pm23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/Multi/RG.pm b/lib/Multi/RG.pm
index eade569a..401b5e70 100644
--- a/lib/Multi/RG.pm
+++ b/lib/Multi/RG.pm
@@ -181,11 +181,12 @@ sub gv_vnrels {
($_->[0], $_->[1]) = ($_->[1], $_->[0]);
$_->[2] = $VNDB::S{vn_relations}{$_->[2]}[1];
}
- my $rev = $VNDB::S{vn_relations}{$_->[2]}[1];
+ my $rel = $VNDB::S{vn_relations}{$_->[2]}[2];
+ my $rev = $VNDB::S{vn_relations}{ $VNDB::S{vn_relations}{$_->[2]}[1] }[2];
my $style = $_->[3] ? '' : ', style="dotted"';
- my $label = $rev ne $_->[2]
- ? qq|headlabel = "\$____vnrel_$_->[2]____\$" taillabel = "\$____vnrel_${rev}____\$" $style|
- : qq|label = "\$____vnrel_$_->[2]____\$" $style|;
+ my $label = $rev ne $rel
+ ? qq|headlabel = "$rel" taillabel = "${rev}" $style|
+ : qq|label = "$rel" $style|;
$r .= qq|\tv$$_[1] -- v$$_[0] [ $label ]\n|;
}
$r;
@@ -209,9 +210,10 @@ sub gv_prodnode {
qq|\tp%d [ id = "node_p%1\$d", URL = "/p%1\$d", tooltip = "%s", label=<|.
q|<TABLE CELLSPACING="0" CELLPADDING="1" BORDER="0" CELLBORDER="1" BGCOLOR="#222222">|.
q|<TR><TD COLSPAN="2" ALIGN="CENTER" CELLPADDING="2"><FONT POINT-SIZE="%d"> %s </FONT></TD></TR>|.
- q|<TR><TD ALIGN="CENTER"> $_lang_%s_$ </TD><TD ALIGN="CENTER"> $_ptype_%s_$ </TD></TR>|.
+ q|<TR><TD ALIGN="CENTER"> %s </TD><TD ALIGN="CENTER"> %s </TD></TR>|.
qq|</TABLE>> ]\n|,
- $n->{id}, encode_utf8($tooltip), $O{fsize}[2], encode_utf8($name), $n->{lang}, $n->{type};
+ $n->{id}, encode_utf8($tooltip), $O{fsize}[2], encode_utf8($name),
+ $VNDB::S{languages}{$n->{lang}}, $VNDB::S{producer_types}{$n->{type}};
}
@@ -224,10 +226,11 @@ sub gv_prodrels {
my $p1 = $prods->{$1};
my $p2 = $prods->{$2};
- my $rev = $VNDB::S{prod_relations}{$rels->{$_}[0]}[1];
- my $label = $rev ne $rels->{$_}[0]
- ? qq|headlabel = "\$____prodrel_${rev}____\$", taillabel = "\$____prodrel_$rels->{$_}[0]____\$"|
- : qq|label = "\$____prodrel_$rels->{$_}[0]____\$"|;
+ my $rel = $VNDB::S{prod_relations}{$rels->{$_}[0]}[2];
+ my $rev = $VNDB::S{prod_relations}{ $VNDB::S{prod_relations}{$rels->{$_}[0]}[1] }[2];
+ my $label = $rev ne $rel
+ ? qq|headlabel = "$rev", taillabel = "$rel"|
+ : qq|label = "$rel"|;
$r .= qq|\tp$p1->{id} -- p$p2->{id} [ $label ]\n|;
}
$r;