30 private static $familygender = [
39 'translatewiki.net' =>
'n',
87 $lord = strtolower( $word );
89 if ( preg_match(
'/wiki$/', $lord ) ) {
92 if ( isset( self::$familygender[$lord] ) ) {
93 $gender = self::$familygender[$lord];
95 $case =
' ' . strtolower( $case );
96 if ( preg_match(
'/ [is]/', $case ) ) {
97 # däm WikiMaatplaz singe, dä Wikipeedija iere, däm Wikiwööterbooch singe
98 # dem/em WikiMaatplaz singe, de Wikipeedija iere, dem/em Wikiwööterbooch singe
99 # däm WikiMaatplaz sing, dä Wikipeedija ier, däm Wikiwööterbooch sing
100 # dem/em WikiMaatplaz sing, de Wikipeedija ier, dem/em Wikiwööterbooch sing
101 $word = ( preg_match(
'/ b/', $case )
102 ? ( $gender ==
'f' ?
'dä' :
'däm' )
103 : ( $gender ==
'f' ?
'de' :
'dem' )
104 ) .
' ' . $word .
' ' .
105 ( $gender ==
'f' ?
'ier' :
'sing' ) .
106 ( preg_match(
'/ m/', $case ) ?
'e' :
''
108 } elseif ( preg_match(
'/ e/', $case ) ) {
109 # en dämm WikiMaatPlaz, en dä Wikipeedija, en dämm Wikiwööterbooch
110 # em WikiMaatplaz, en de Wikipeedija, em Wikiwööterbooch
111 if ( preg_match(
'/ b/', $case ) ) {
112 $word =
'en ' . ( $gender ==
'f' ?
'dä' :
'däm' ) .
' ' . $word;
114 $word = ( $gender ==
'f' ?
'en de' :
'em' ) .
' ' . $word;
116 } elseif ( preg_match(
'/ [fv]/', $case ) || preg_match(
'/ [2jg]/', $case ) ) {
117 # vun däm WikiMaatplaz, vun dä Wikipeedija, vun däm Wikiwööterbooch
118 # vum WikiMaatplaz, vun de Wikipeedija, vum Wikiwööterbooch
119 if ( preg_match(
'/ b/', $case ) ) {
120 $word =
'vun ' . ( $gender ==
'f' ?
'dä' :
'däm' ) .
' ' . $word;
122 $word = ( $gender ==
'f' ?
'vun de' :
'vum' ) .
' ' . $word;
124 } elseif ( preg_match(
'/ [3d]/', $case ) ) {
125 # dämm WikiMaatPlaz, dä Wikipeedija, dämm Wikiwööterbooch
126 # dem/em WikiMaatplaz, de Wikipeedija, dem/em Wikiwööterbooch
127 if ( preg_match(
'/ b/', $case ) ) {
128 $word = ( $gender ==
'f' ?
'dää' :
'dämm' ) .
' ' . $word;
130 $word = ( $gender ==
'f' ?
'de' :
'dem' ) .
' ' . $word;
133 # dä WikiMaatPlaz, di Wikipeedija, dat Wikiwööterbooch
134 # der WikiMaatplaz, de Wikipeedija, et Wikiwööterbooch
135 if ( preg_match(
'/ b/', $case ) ) {
158 $word = $lord .
' ' . $word;
173 if ( is_string( $forms ) ) {
176 if ( !count( $forms ) ) {
183 } elseif ( $count == 0 ) {
convertPlural( $count, $forms)
Handle cases of (1, other, 0) or (1, other)
convertGrammar( $word, $case)
Convert from the nominative form of a noun to other cases.
Base class for language-specific code.
preConvertPlural($forms, $count)
Checks that convertPlural was given an array and pads it to requested amount of forms by copying the ...
handleExplicitPluralForms( $count, array $forms)
Handles explicit plural forms for Language::convertPlural()