diff options
author | maedhros <maedhros@openttd.org> | 2008-03-25 17:39:02 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2008-03-25 17:39:02 +0000 |
commit | 2023f5954122a7dbb66963cfaa54678719aae011 (patch) | |
tree | 28c066eb77e080efcc4b12c7cf16bbacb7f04ef0 | |
parent | 6184676ec76e0512f51e98ec06d6f3b152411025 (diff) | |
download | openttd-2023f5954122a7dbb66963cfaa54678719aae011.tar.xz |
(svn r12417) -Fix: Add a new plural rule for Icelandic.
-rw-r--r-- | src/lang/icelandic.txt | 2 | ||||
-rw-r--r-- | src/strgen/strgen.cpp | 2 | ||||
-rw-r--r-- | src/strings.cpp | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 3efbd0208..262d675c6 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1,7 +1,7 @@ ##name Icelandic ##ownname Íslenska ##isocode is_IS -##plural 0 +##plural 9 ##gender karlkyn kvenkyn hvorugkyn # diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 1147e7aec..d05f0e796 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -103,7 +103,7 @@ static char _cases[MAX_NUM_CASES][16]; static int _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 }; +static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4, 2 }; static const char *_cur_ident; diff --git a/src/strings.cpp b/src/strings.cpp index 9338c99a4..32f2a297c 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -462,6 +462,12 @@ static int DeterminePluralForm(int64 cnt) * Slovenian */ case 8: return n % 100 == 1 ? 0 : n % 100 == 2 ? 1 : n % 100 == 3 || n % 100 == 4 ? 2 : 3; + + /* Two forms; singular used for everything ending in 1 but not in 11. + * Used in: + * Icelandic */ + case 9: + return n % 10 == 1 && n % 100 != 11 ? 0 : 1; } } |