From 402e2374a6a8e3eb60591342a2fe3cee4abfa548 Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 7 Apr 2009 00:05:44 +0000 Subject: [PATCH] (svn r15965) -Change: use recent Czech language for plural form (it has been official for years anyway) --- src/lang/czech.txt | 2 +- src/strgen/strgen.cpp | 2 +- src/strings.cpp | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lang/czech.txt b/src/lang/czech.txt index cf8edc05bb..7592456859 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -3,7 +3,7 @@ ##isocode cs_CZ ##winlangid 0x0405 ##grflangid 0x15 -##plural 6 +##plural 10 ##case nom gen dat acc voc loc ins big small ##gender m f n diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 04a59b3876..6bec630943 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -99,7 +99,7 @@ static char _cases[MAX_NUM_CASES][16]; static uint _numcases; /* for each plural value, this is the number of plural forms. */ -static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4, 2 }; +static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4, 2, 3 }; static const char *_cur_ident; diff --git a/src/strings.cpp b/src/strings.cpp index f3179573bd..7cf2d730a5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -439,7 +439,7 @@ static int DeterminePluralForm(int64 count) /* Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] * Used in: - * Croatian, Czech, Russian, Slovak, Ukrainian */ + * Croatian, Russian, Slovak, Ukrainian */ case 6: return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2; @@ -460,6 +460,12 @@ static int DeterminePluralForm(int64 count) * Icelandic */ case 9: return n % 10 == 1 && n % 100 != 11 ? 0 : 1; + + /* Three forms, special cases for one and 2, 3, or 4 + * Used in: + * Czech */ + case 10: + return n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2; } }