r49598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49597‎ | r49598 | r49599 >
Date:13:32, 17 April 2009
Author:raymond
Status:ok
Tags:
Comment:
* Add PLURAL function for Scots Gaelic (gd)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/languages/classes/LanguageGd.php (added) (history)

Diff [purge]

Index: trunk/phase3/languages/classes/LanguageGd.php
@@ -0,0 +1,35 @@
 2+<?php
 3+/** Scots Gaelic (Gàidhlig)
 4+ *
 5+ * @ingroup Language
 6+ *
 7+ * @author Raimond Spekking
 8+ */
 9+class LanguageGd extends Language {
 10+
 11+ /**
 12+ * Plural form transformations
 13+ * Based on this discussion: http://translatewiki.net/w/i.php?title=Portal_talk:Gd&oldid=1094065#%C3%80ireamhan
 14+ *
 15+ * $forms[0] - singular form (for 1)
 16+ * $forms[1] - dual form (for 2)
 17+ * $forms[2] - plural form 1 (for 3-10)
 18+ * $forms[3] - plural form 2 (for >= 11)
 19+ *
 20+ */
 21+ function convertPlural( $count, $forms ) {
 22+ if ( !count($forms) ) { return ''; }
 23+ $forms = $this->preConvertPlural( $forms, 4 );
 24+
 25+ $count = abs( $count );
 26+ if ( $count === 1 ) {
 27+ return $forms[0];
 28+ } elseif ( $count === 2 ) {
 29+ return $forms[1];
 30+ } elseif ( $count >= 3 && $count <= 10 ) {
 31+ return $forms[2];
 32+ } else {
 33+ return $forms[3];
 34+ }
 35+ }
 36+}
Property changes on: trunk/phase3/languages/classes/LanguageGd.php
___________________________________________________________________
Name: svn:eol-style
137 + native
Index: trunk/phase3/RELEASE-NOTES
@@ -427,6 +427,7 @@
428428 * (bug 16909) 'histlegend' now reuses messages instead of copying them
429429 * Traditional/Simplified Gan Chinese conversion support
430430 * (bug 18474) Sorani (ckb - Central Kurdish) (renamed from ku-arab)
 431+* Add PLURAL function for Scots Gaelic (gd)
431432
432433 == Compatibility ==
433434

Status & tagging log