X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageRu.php;h=7b15721a57465ffa01829006cbbe76466837cfc6;hb=3b5b239e853c78114147a51b7c66b13e0ccd561d;hp=60384a85e32c0eb724b1d7b997e702b9ca7686b0;hpb=415b31766677e190c13322742b4e42da1157538c;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php index 60384a85e3..7b15721a57 100644 --- a/languages/classes/LanguageRu.php +++ b/languages/classes/LanguageRu.php @@ -31,46 +31,9 @@ * @ingroup Language */ class LanguageRu extends Language { - - /** - * Convert from the nominative form of a noun to some other case - * Invoked with {{grammar:case|word}} - * - * @param string $word - * @param string $case - * @return string - */ - function convertGrammar( $word, $case ) { - global $wgGrammarForms; - if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) { - return $wgGrammarForms['ru'][$case][$word]; - } - - $grammarDataFile = __DIR__ . '/data/grammar.ru.json'; - $grammarData = FormatJson::decode( file_get_contents( $grammarDataFile ), true ); - - if ( array_key_exists( $case, $grammarData ) ) { - foreach ( array_keys( $grammarData[$case] ) as $form ) { - if ( $form === '@metadata' ) { - continue; - } - - $regex = "/$form/"; - - if ( preg_match( $regex, $word ) ) { - $word = preg_replace( $regex, $grammarData[$case][$form], $word ); - - break; - } - } - } - - return $word; - } - /** * Four-digit number should be without group commas (spaces) - * See manual of style at http://ru.wikipedia.org/wiki/Википедия:Оформление_статей + * See manual of style at https://ru.wikipedia.org/wiki/Википедия:Оформление_статей * So "1 234 567", "12 345" but "1234" * * @param string $_