summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-05-14 12:29:49 +0200
committerYorhel <git@yorhel.nl>2021-05-14 12:34:37 +0200
commitba6ff4ee302fada4e838d6f3c64a79536e8cfb26 (patch)
treeeec46b25603f0fd24ba0e759f53670c7cbd721a7 /lib/VNDB/Func.pm
parent92ef4761c5212c579c093631576717614af3992b (diff)
Releases: Add MTL language flag
Fixes https://vndb.org/t7126 And as recently discussed again in https://vndb.org/t15635
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index e1f6ac13..7dfd011c 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -272,7 +272,7 @@ sub fmtspoil {
# Generates a HTML 'lang' attribute given a list of possible languages.
# This is used for the 'original language' field, which we can safely assume is not used for latin-alphabet languages.
sub lang_attr {
- my @l = ref $_[0] ? $_[0]->@* : @_;
+ my @l = map ref($_) eq 'HASH' ? $_->{lang} : $_, ref $_[0] ? $_[0]->@* : @_;
# Choose Japanese, Chinese or Korean (in order of likelyness) if those are in the list.
return (lang => 'ja') if grep $_ eq 'ja', @l;
return (lang => 'zh') if grep $_ eq 'zh', @l;