summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-04-17 11:16:34 +0000
committerrubidium <rubidium@openttd.org>2010-04-17 11:16:34 +0000
commit23c9573b64ba693509f3cf51158e131c96e032ce (patch)
tree12cb7b7bb170b44c9b1ccacdca30a4944653b0c1 /src/strings.cpp
parentb907dfdef840bf0db681b6f996ec912d516efafd (diff)
downloadopenttd-23c9573b64ba693509f3cf51158e131c96e032ce.tar.xz
(svn r19649) -Add: plural rule for Maltese
-Fix: plural rule for Irish
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index d063a34a6..613ee8ffc 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -392,17 +392,17 @@ static int DeterminePluralForm(int64 count)
case 2:
return n > 1;
- /* Three forms, special case for zero
+ /* Three forms, special case for 0 and ending in 1, except those ending in 11
* Used in:
* Latvian */
case 3:
return n % 10 == 1 && n % 100 != 11 ? 0 : n != 0 ? 1 : 2;
- /* Three forms, special case for one and two
+ /* Five forms, special case for one, two, 3 to 6 and 7 to 10
* Used in:
* Gaelige (Irish) */
case 4:
- return n == 1 ? 0 : n == 2 ? 1 : 2;
+ return n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4;
/* Three forms, special case for numbers ending in 1[2-9]
* Used in:
@@ -465,6 +465,12 @@ static int DeterminePluralForm(int64 count)
default:
NOT_REACHED();
}
+
+ /* Four forms: one, 0 and everything ending in 02..10, everything ending in 11..19.
+ * Used in:
+ * Maltese */
+ case 12:
+ return (n == 1 ? 0 : n == 0 || (n % 100 > 1 && n % 100 < 11) ? 1 : (n % 100 > 10 && n % 100 < 20) ? 2 : 3);
}
}