* Add PLURAL function for Scots Gaelic (gd)
authorRaimond Spekking <raymond@users.mediawiki.org>
Fri, 17 Apr 2009 13:32:49 +0000 (13:32 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Fri, 17 Apr 2009 13:32:49 +0000 (13:32 +0000)
RELEASE-NOTES
languages/classes/LanguageGd.php [new file with mode: 0644]

index 6e23fe7..7fa8aae 100644 (file)
@@ -427,6 +427,7 @@ changes to languages because of MediaZilla reports.
 * (bug 16909) 'histlegend' now reuses messages instead of copying them
 * Traditional/Simplified Gan Chinese conversion support
 * (bug 18474) Sorani (ckb - Central Kurdish) (renamed from ku-arab)
+* Add PLURAL function for Scots Gaelic (gd)
 
 == Compatibility ==
 
diff --git a/languages/classes/LanguageGd.php b/languages/classes/LanguageGd.php
new file mode 100644 (file)
index 0000000..6c307f6
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/** Scots Gaelic (GĂ idhlig)
+ *
+ * @ingroup Language
+ *
+ * @author Raimond Spekking
+ */
+class LanguageGd extends Language {
+
+       /**
+        * Plural form transformations
+        * Based on this discussion: http://translatewiki.net/w/i.php?title=Portal_talk:Gd&oldid=1094065#%C3%80ireamhan
+        *
+        * $forms[0] - singular form (for 1)
+        * $forms[1] - dual form (for 2)
+        * $forms[2] - plural form 1 (for 3-10)
+        * $forms[3] - plural form 2 (for >= 11)
+        *
+        */
+       function convertPlural( $count, $forms ) {
+               if ( !count($forms) ) { return ''; }
+               $forms = $this->preConvertPlural( $forms, 4 );
+
+               $count = abs( $count );
+               if ( $count === 1 ) {
+                       return $forms[0];
+               } elseif ( $count === 2 ) {
+                       return $forms[1];
+               } elseif ( $count >= 3 && $count <= 10 ) {
+                       return $forms[2];
+               } else {
+                       return $forms[3];
+               }
+       }
+}