X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageHy.php;h=602a589078c46340fdadfaa9972a60232fc7142c;hb=302e19c143d55cca7e10e37f3bf72a886e52b1be;hp=7cedcc523c58d892e1e997362b3205454e64912f;hpb=376879ee06871beb31ca540bbcc87843aa2fb744;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index 7cedcc523c..602a589078 100644 --- a/languages/classes/LanguageHy.php +++ b/languages/classes/LanguageHy.php @@ -47,17 +47,17 @@ class LanguageHy extends Language { # 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(); + $ar = []; preg_match_all( '/./us', $word, $ar ); if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) { switch ( $case ) { case 'genitive': # սեռական հոլով - if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' ) { - $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'այի'; - } elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' ) { - $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի'; - } elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) { - $word = join( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի'; + if ( implode( '', array_slice( $ar[0], -1 ) ) == 'ա' ) { + $word = implode( '', array_slice( $ar[0], 0, -1 ) ) . 'այի'; + } elseif ( implode( '', array_slice( $ar[0], -1 ) ) == 'ո' ) { + $word = implode( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի'; + } elseif ( implode( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) { + $word = implode( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի'; } else { $word .= 'ի'; } @@ -78,19 +78,4 @@ class LanguageHy extends Language { } return $word; } - - /** - * Armenian numeric format is "12 345,67" but "1234,56" - * - * @param string $_ - * - * @return string - */ - function commafy( $_ ) { - if ( !preg_match( '/^\d{1,4}$/', $_ ) ) { - return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) ); - } else { - return $_; - } - } }