diff options
author | Yorhel <git@yorhel.nl> | 2009-11-14 10:50:22 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-11-14 10:51:53 +0100 |
commit | 0a4f97f0186d6941a4cab2e3bd05201f1fed1441 (patch) | |
tree | 9437668b84a87b5d2ca516f7b3f706dbefebf732 /lib/VNDB/Func.pm | |
parent | 615b7bd42d96566e9cb1db5bb36870b87817af2f (diff) |
SQL/L10N: Allow NULL for releases_rev.minage and make the values translatable
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r-- | lib/VNDB/Func.pm | 17 |
1 files changed, 16 insertions, 1 deletions
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; |