From 33c4f9d4cd7a14b4db347515ba3aa6b9f6cf99bb Mon Sep 17 00:00:00 2001 From: Yorhel Date: Fri, 2 Oct 2009 13:28:55 +0200 Subject: L10N-CS: Added Czech quant() --- lib/VNDB/L10N.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/VNDB/L10N.pm b/lib/VNDB/L10N.pm index e19302ed..279cbd31 100644 --- a/lib/VNDB/L10N.pm +++ b/lib/VNDB/L10N.pm @@ -11,7 +11,7 @@ use warnings; # used for the language switch interface, language tags must # be the same as in the languages hash in global.pl - sub languages { ('en', 'ru') } + sub languages { ('en', 'ru', 'cs') } sub maketext { my $r = eval { shift->SUPER::maketext(@_) }; @@ -25,6 +25,7 @@ use warnings; my %lang = ( en => \%VNDB::L10N::en::Lexicon, ru => \%VNDB::L10N::ru::Lexicon, + cs => \%VNDB::L10N::cs::Lexicon, ); my $r = LangFile->new(read => "$VNDB::ROOT/data/lang.txt"); my $key; @@ -140,5 +141,21 @@ use warnings; } + +{ + package VNDB::L10N::cs; + use base 'VNDB::L10N::en'; + our %Lexicon; + + sub quant { + my($self, $num, $single, $couple, $lots) = @_; + return $lots if ($num % 100) >= 11 && ($num % 100) <= 14; + return $single if ($num % 10) == 1; + return $couple if ($num % 10) >= 2 && ($num % 10) <= 4; + return $lots; + } +} + + 1; -- cgit v1.2.3