r89856 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89855‎ | r89856 | r89857 >
Date:22:33, 10 June 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Follow-up to r75241 / 75241: rename LanguageBat_smg to LanguageSgs
Modified paths:
  • /trunk/phase3/languages/classes/LanguageBat_smg.php (deleted) (history)
  • /trunk/phase3/languages/classes/LanguageSgs.php (added) (history)

Diff [purge]

Index: trunk/phase3/languages/classes/LanguageBat_smg.php
@@ -1,30 +0,0 @@
2 -<?php
3 -/** Samogitian (Žemaitėška)
4 - *
5 - * @ingroup Language
6 - *
7 - * @author Niklas Laxström
8 - */
9 -class LanguageBat_smg extends Language {
10 -
11 - /**
12 - * @param $count int
13 - * @param $forms array
14 - * @return string
15 - */
16 - function convertPlural( $count, $forms ) {
17 - if ( !count( $forms ) ) { return ''; }
18 - $forms = $this->preConvertPlural( $forms, 4 );
19 -
20 - $count = abs( $count );
21 - if ( $count === 0 || ( $count % 100 === 0 || ( $count % 100 >= 10 && $count % 100 < 20 ) ) ) {
22 - return $forms[2];
23 - } elseif ( $count % 10 === 1 ) {
24 - return $forms[0];
25 - } elseif ( $count % 10 === 2 ) {
26 - return $forms[1];
27 - } else {
28 - return $forms[3];
29 - }
30 - }
31 -}
Index: trunk/phase3/languages/classes/LanguageSgs.php
@@ -0,0 +1,30 @@
 2+<?php
 3+/** Samogitian (Žemaitėška)
 4+ *
 5+ * @ingroup Language
 6+ *
 7+ * @author Niklas Laxström
 8+ */
 9+class LanguageSgs extends Language {
 10+
 11+ /**
 12+ * @param $count int
 13+ * @param $forms array
 14+ * @return string
 15+ */
 16+ function convertPlural( $count, $forms ) {
 17+ if ( !count( $forms ) ) { return ''; }
 18+ $forms = $this->preConvertPlural( $forms, 4 );
 19+
 20+ $count = abs( $count );
 21+ if ( $count === 0 || ( $count % 100 === 0 || ( $count % 100 >= 10 && $count % 100 < 20 ) ) ) {
 22+ return $forms[2];
 23+ } elseif ( $count % 10 === 1 ) {
 24+ return $forms[0];
 25+ } elseif ( $count % 10 === 2 ) {
 26+ return $forms[1];
 27+ } else {
 28+ return $forms[3];
 29+ }
 30+ }
 31+}
Property changes on: trunk/phase3/languages/classes/LanguageSgs.php
___________________________________________________________________
Added: svn:eol-style
132 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75241Rename MessagesBat_smg.php to MessagesSgs.php. Follow-up to r74771. Needs a f...siebrand14:47, 23 October 2010

Comments

#Comment by 😂 (talk | contribs)   19:31, 21 June 2011

Release-notes, $wgDummyLanguageCodes, etc? You did those similar changes in r89329

#Comment by SPQRobin (talk | contribs)   19:44, 21 June 2011

Bat-smg -> sgs had been done in r74771, r75240, r75241 and r75244. However, this file was forgotten. (Release-notes was forgotten as well, but the rename was done in 1.16 or 1.17 so I didn't add it.)

#Comment by 😂 (talk | contribs)   19:45, 21 June 2011

Ah ok, thanks for the links that makes it way clearer :)

Status & tagging log