From 0a4f97f0186d6941a4cab2e3bd05201f1fed1441 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 14 Nov 2009 10:50:22 +0100 Subject: SQL/L10N: Allow NULL for releases_rev.minage and make the values translatable --- lib/VNDB/Func.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/VNDB/Func.pm') diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm index 49df0121..1801e3b8 100644 --- a/lib/VNDB/Func.pm +++ b/lib/VNDB/Func.pm @@ -6,7 +6,7 @@ use warnings; use YAWF ':html'; use Exporter 'import'; use POSIX 'strftime', 'ceil', 'floor'; -our @EXPORT = qw| shorten bb2html gtintype liststat clearfloat cssicon tagscore mt |; +our @EXPORT = qw| shorten bb2html gtintype liststat clearfloat cssicon tagscore mt minage |; # I would've done this as a #define if this was C... @@ -221,5 +221,20 @@ sub mt { } +sub minage { + my($a, $ex) = @_; + my $str = !defined($a) ? mt '_minage_null' : !$a ? mt '_minage_all' : mt '_minage_age', $a; + $ex = !defined($a) ? '' : { + 0 => 'CERO A', + 12 => 'CERO B', + 15 => 'CERO C', + 17 => 'CERO D', + 18 => 'CERO Z', + }->{$a} if $ex; + return $str if !$ex; + return $str.' '.mt('_minage_example', $ex); +} + + 1; -- cgit v1.2.3