summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-02 13:28:55 +0200
committerYorhel <git@yorhel.nl>2009-10-19 16:24:05 +0200
commit33c4f9d4cd7a14b4db347515ba3aa6b9f6cf99bb (patch)
tree80568618c6076390306723f771313489607dadef /lib
parent538000a678b4110394f1aaf413059bcdd43c5005 (diff)
L10N-CS: Added Czech quant()
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/L10N.pm19
1 files changed, 18 insertions, 1 deletions
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;