word: distinguish include and images by language
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 26 May 2020 07:27:17 +0000 (09:27 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 6 Jun 2020 01:49:20 +0000 (03:49 +0200)
Prepare for translations with different visualisations.

word.plp

index d594370e2d09728ec6b9dab79c97527a811d2ddf..ca850709f86790f6784f10907da8ee23595a80d7 100644 (file)
--- a/word.plp
+++ b/word.plp
@@ -1,6 +1,6 @@
 <(common.inc.plp)><:
 
-my $wordlist = 'wordlist.inc.pl';
+my $wordlist = 'wordlist.eng.inc.pl';
 Html({
        title => 'words cheat sheet',
        version => '1.0',
@@ -65,7 +65,7 @@ Zie ook <a href="/dieren">dieren</a>.
 </p>
 
 <:
-my %table = do 'wordlist.inc.pl' or die $@ // $!;
+my $table = do $wordlist or die $@ // $!;
 
 sub showimg {
        my ($name) = @_;
@@ -76,7 +76,7 @@ sub showimg {
        my $alt = $name;
        $name = "<q>$name</q>" if $name =~ s/\?$//;
 
-       if ($img and -e ($img = "data/word/$img.jpg")) {
+       if ($img and -e ($img = "data/word/eng/$img.jpg")) {
                my $alt = -l $img && readlink($img) =~ s/\.jpg$//r;
                if ($alt) {
                        $name .= " ($alt)";