X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageHy.php;h=b7767eb3a65d37de2a9486537c53dcc054fd8a13;hb=581159d52f4074c5b4da7e4554f7d623d723ee6e;hp=507981318c9d9848bce3db29eb2e9e9ff24ebb05;hpb=4feea6a4ec1fe0a1f7a2518d89c293fdb2df5f22;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index 507981318c..b7767eb3a6 100644 --- a/languages/classes/LanguageHy.php +++ b/languages/classes/LanguageHy.php @@ -33,8 +33,8 @@ class LanguageHy 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 ) { @@ -49,17 +49,18 @@ class LanguageHy extends Language { # join and array_slice instead mb_substr $ar = array(); preg_match_all( '/./us', $word, $ar ); - if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) + if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) { switch ( $case ) { case 'genitive': # սեռական հոլով - if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' ) + if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' ) { $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'այի'; - elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' ) + } elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' ) { $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի'; - elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) + } elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) { $word = join( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի'; - else + } else { $word .= 'ի'; + } break; case 'dative': # Տրական հոլով # stub @@ -74,13 +75,14 @@ class LanguageHy extends Language { # stub break; } + } return $word; } /** * Armenian numeric format is "12 345,67" but "1234,56" * - * @param $_ string + * @param string $_ * * @return string */