X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageCu.php;h=650f1ba6b7db199ba69ab0943b2c6ecb44208438;hb=895987c4fc32b717d544f5ef0c238affe23d8796;hp=60cf2b1a9a01d24717b5edd52f119cf5df7c829d;hpb=5c3fecdb372bbd96301a1c21d8fae3219c55a356;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageCu.php b/languages/classes/LanguageCu.php index 60cf2b1a9a..650f1ba6b7 100644 --- a/languages/classes/LanguageCu.php +++ b/languages/classes/LanguageCu.php @@ -27,23 +27,24 @@ * @ingroup Language */ class LanguageCu extends Language { - /** * Convert from the nominative form of a noun to some other case * Invoked with {{grammar:case|word}} * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { global $wgGrammarForms; + if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) { return $wgGrammarForms['сu'][$case][$word]; } - # These rules are not perfect, but they are currently only used for site names so it doesn't - # matter if they are wrong sometimes. Just add a special case for your site name if necessary. + # These rules are not perfect, but they are currently only used for + # site names so it doesn't matter if they are wrong sometimes. Just add + # a special case for your site name if necessary. # join and array_slice instead mb_substr $ar = array(); @@ -51,7 +52,9 @@ class LanguageCu extends Language { if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) { switch ( $case ) { case 'genitive': # родительный падеж - if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) ) { + if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) + || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) + ) { } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' ) { $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ'; } @@ -61,6 +64,7 @@ class LanguageCu extends Language { break; } } + return $word; } }