MediaWiki  1.23.8
LanguageKsh.php
Go to the documentation of this file.
1 <?php
30 class LanguageKsh extends Language {
31  static $familygender = array(
32  // Do not add male wiki families, since that's the default.
33  // No need add neuter wikis having names ending in -wiki.
34  'wikipedia' => 'f',
35  'wikiversity' => 'f',
36  'wiktionary' => 'n',
37  'wikibooks' => 'n',
38  'wikiquote' => 'n',
39  'wikisource' => 'n',
40  'wikitravel' => 'n',
41  'wikia' => 'f',
42  'translatewiki.net' => 'n',
43  );
44 
91  function convertGrammar( $word, $case ) {
92  $lord = strtolower( $word );
93  $gender = 'm'; // Nuutnaarel // default
94  if ( preg_match ( '/wiki$/', $lord ) ) {
95  $gender = 'n'; // Dat xyz-wiki
96  }
97  if ( isset( self::$familygender[$lord] ) ) {
98  $gender = self::$familygender[$lord];
99  }
100  $case = ' ' . strtolower( $case );
101  if ( preg_match( '/ [is]/', $case ) ) {
102  # däm WikiMaatplaz singe, dä Wikipeedija iere, däm Wikiwööterbooch singe
103  # dem/em WikiMaatplaz singe, de Wikipeedija iere, dem/em Wikiwööterbooch singe
104  # däm WikiMaatplaz sing, dä Wikipeedija ier, däm Wikiwööterbooch sing
105  # dem/em WikiMaatplaz sing, de Wikipeedija ier, dem/em Wikiwööterbooch sing
106  $word = ( preg_match( '/ b/', $case )
107  ? ( $gender == 'f' ? 'dä' : 'däm' )
108  : ( $gender == 'f' ? 'de' : 'dem' )
109  ) . ' ' . $word . ' ' .
110  ( $gender == 'f' ? 'ier' : 'sing' ) .
111  ( preg_match( '/ m/', $case ) ? 'e' : ''
112  );
113  } elseif ( preg_match( '/ e/', $case ) ) {
114  # en dämm WikiMaatPlaz, en dä Wikipeedija, en dämm Wikiwööterbooch
115  # em WikiMaatplaz, en de Wikipeedija, em Wikiwööterbooch
116  if ( preg_match( '/ b/', $case ) ) {
117  $word = 'en ' . ( $gender == 'f' ? 'dä' : 'däm' ) . ' ' . $word;
118  } else {
119  $word = ( $gender == 'f' ? 'en de' : 'em' ) . ' ' . $word;
120  }
121  } elseif ( preg_match( '/ [fv]/', $case ) || preg_match( '/ [2jg]/', $case ) ) {
122  # vun däm WikiMaatplaz, vun dä Wikipeedija, vun däm Wikiwööterbooch
123  # vum WikiMaatplaz, vun de Wikipeedija, vum Wikiwööterbooch
124  if ( preg_match( '/ b/', $case ) ) {
125  $word = 'vun ' . ( $gender == 'f' ? 'dä' : 'däm' ) . ' ' . $word;
126  } else {
127  $word = ( $gender == 'f' ? 'vun de' : 'vum' ) . ' ' . $word;
128  }
129  } elseif ( preg_match( '/ [3d]/', $case ) ) {
130  # dämm WikiMaatPlaz, dä Wikipeedija, dämm Wikiwööterbooch
131  # dem/em WikiMaatplaz, de Wikipeedija, dem/em Wikiwööterbooch
132  if ( preg_match( '/ b/', $case ) ) {
133  $word = ( $gender == 'f' ? 'dää' : 'dämm' ) . ' ' . $word;
134  } else {
135  $word = ( $gender == 'f' ? 'de' : 'dem' ) . ' ' . $word;
136  }
137  } else {
138  # dä WikiMaatPlaz, di Wikipeedija, dat Wikiwööterbooch
139  # der WikiMaatplaz, de Wikipeedija, et Wikiwööterbooch
140  if ( preg_match( '/ b/', $case ) ) {
141  switch ( $gender ) {
142  case 'm':
143  $lord = 'dä';
144  break;
145  case 'f':
146  $lord = 'di';
147  break;
148  default:
149  $lord = 'dat';
150  }
151  } else {
152  switch ( $gender ) {
153  case 'm':
154  $lord = 'der';
155  break;
156  case 'f':
157  $lord = 'de';
158  break;
159  default:
160  $lord = 'et';
161  }
162  }
163  $word = $lord . ' ' . $word;
164  }
165  return $word;
166  }
167 
175  public function commafy( $_ ) {
176  if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
177  return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
178  } else {
179  return $_;
180  }
181  }
182 
191  function convertPlural( $count, $forms ) {
192  $forms = $this->handleExplicitPluralForms( $count, $forms );
193  if ( is_string( $forms ) ) {
194  return $forms;
195  }
196  if ( !count( $forms ) ) {
197  return '';
198  }
199  $forms = $this->preConvertPlural( $forms, 3 );
200 
201  if ( $count == 1 ) {
202  return $forms[0];
203  } elseif ( $count == 0 ) {
204  return $forms[2];
205  } else {
206  return $forms[1];
207  }
208  }
209 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Language\preConvertPlural
preConvertPlural($forms, $count)
Checks that convertPlural was given an array and pads it to requested amount of forms by copying the ...
Definition: Language.php:3694
LanguageKsh
Ripuarian (Ripoarėsh)
Definition: LanguageKsh.php:30
LanguageKsh\convertPlural
convertPlural( $count, $forms)
Handle cases of (1, other, 0) or (1, other)
Definition: LanguageKsh.php:191
LanguageKsh\convertGrammar
convertGrammar( $word, $case)
Convert from the nominative form of a noun to other cases.
Definition: LanguageKsh.php:91
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Language\handleExplicitPluralForms
handleExplicitPluralForms( $count, array $forms)
Handles explicit plural forms for Language::convertPlural()
Definition: Language.php:3673
LanguageKsh\commafy
commafy( $_)
Avoid grouping whole numbers between 0 to 9999.
Definition: LanguageKsh.php:175
$count
$count
Definition: UtfNormalTest2.php:96
LanguageKsh\$familygender
static $familygender
Definition: LanguageKsh.php:31
Language
Internationalisation code.
Definition: Language.php:74