diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /languages/classes | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'languages/classes')
44 files changed, 386 insertions, 406 deletions
diff --git a/languages/classes/LanguageAr.php b/languages/classes/LanguageAr.php index 553ff077..858a7be8 100644 --- a/languages/classes/LanguageAr.php +++ b/languages/classes/LanguageAr.php @@ -36,7 +36,7 @@ class LanguageAr extends Language { * @todo FIXME: This is language-specific for now only to avoid the negative * performance impact of enabling it for all languages. * - * @param $s string + * @param string $s * * @return string */ diff --git a/languages/classes/LanguageAz.php b/languages/classes/LanguageAz.php index 48f70e85..2199467d 100644 --- a/languages/classes/LanguageAz.php +++ b/languages/classes/LanguageAz.php @@ -29,7 +29,7 @@ class LanguageAz extends Language { /** - * @param $string string + * @param string $string * @return mixed|string */ function ucfirst( $string ) { diff --git a/languages/classes/LanguageBe_tarask.php b/languages/classes/LanguageBe_tarask.php index 05b9550f..ac593801 100644 --- a/languages/classes/LanguageBe_tarask.php +++ b/languages/classes/LanguageBe_tarask.php @@ -30,14 +30,16 @@ * @ingroup Language * @see http://be-x-old.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php */ +// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error class LanguageBe_tarask extends Language { + // @codingStandardsIgnoreEnd /** * The Belarusian language uses apostrophe sign, * but the characters used for this could be both U+0027 and U+2019. * This function unifies apostrophe sign in search index values * to enable seach using both apostrophe signs. * - * @param $string string + * @param string $string * * @return string */ @@ -60,7 +62,7 @@ class LanguageBe_tarask extends Language { * Four-digit number should be without group commas (spaces) * So "1 234 567", "12 345" but "1234" * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageBg.php b/languages/classes/LanguageBg.php index d735c7a0..a592d025 100644 --- a/languages/classes/LanguageBg.php +++ b/languages/classes/LanguageBg.php @@ -31,7 +31,7 @@ class LanguageBg extends Language { * ISO number formatting: 123 456 789,99. * Avoid tripple grouping by numbers with whole part up to 4 digits. * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageBs.php b/languages/classes/LanguageBs.php index 3da7711e..de9c7dce 100644 --- a/languages/classes/LanguageBs.php +++ b/languages/classes/LanguageBs.php @@ -27,16 +27,14 @@ * @ingroup Language */ class LanguageBs extends Language { - - /** * Convert from the nominative form of a noun to some other case * Invoked with {{GRAMMAR:case|word}} * * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * * @return string */ @@ -54,6 +52,8 @@ class LanguageBs extends Language { break; } - return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values + # this will return the original value for 'nominativ' (nominative) + # and all undefined case values. + return $word; } } diff --git a/languages/classes/LanguageCu.php b/languages/classes/LanguageCu.php index 60cf2b1a..650f1ba6 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; } } diff --git a/languages/classes/LanguageDsb.php b/languages/classes/LanguageDsb.php index 975157f4..2a21307e 100644 --- a/languages/classes/LanguageDsb.php +++ b/languages/classes/LanguageDsb.php @@ -28,13 +28,12 @@ * @ingroup Language */ class LanguageDsb 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,9 +48,10 @@ class LanguageDsb extends Language { case 'lokatiw': # lokatiw $word = 'wo ' . $word; break; - } + } - return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values + # this will return the original value for 'nominatiw' (nominativ) and + # all undefined case values. + return $word; } - } diff --git a/languages/classes/LanguageEo.php b/languages/classes/LanguageEo.php index 0e2d8b4a..15fc8c03 100644 --- a/languages/classes/LanguageEo.php +++ b/languages/classes/LanguageEo.php @@ -54,9 +54,9 @@ class LanguageEo extends Language { * editor behavior; the original server-side translation system dates to 2002-2003 * when many browsers with really bad Unicode support were still in use. * - * @param string $in input character set - * @param string $out output character set - * @param string $string text to be converted + * @param string $in Input character set + * @param string $out Output character set + * @param string $string Text to be converted * @return string */ function iconv( $in, $out, $string ) { @@ -74,7 +74,7 @@ class LanguageEo extends Language { } /** - * @param $matches array + * @param array $matches * @return string */ function strrtuxCallback( $matches ) { @@ -91,7 +91,7 @@ class LanguageEo extends Language { } /** - * @param $matches array + * @param array $matches * @return string */ function strrtxuCallback( $matches ) { diff --git a/languages/classes/LanguageEs.php b/languages/classes/LanguageEs.php index f55c2e43..098148f7 100644 --- a/languages/classes/LanguageEs.php +++ b/languages/classes/LanguageEs.php @@ -29,7 +29,7 @@ class LanguageEs extends Language { /** - * @param $_ string + * @param string $_ * @return string */ function commafy( $_ ) { diff --git a/languages/classes/LanguageEt.php b/languages/classes/LanguageEt.php index 1a9f286f..6425a533 100644 --- a/languages/classes/LanguageEt.php +++ b/languages/classes/LanguageEt.php @@ -30,7 +30,7 @@ class LanguageEt extends Language { /** * Avoid grouping whole numbers between 0 to 9999 * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageFi.php b/languages/classes/LanguageFi.php index ee1d1b52..2379caca 100644 --- a/languages/classes/LanguageFi.php +++ b/languages/classes/LanguageFi.php @@ -28,13 +28,12 @@ * @ingroup Language */ class LanguageFi 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 ) { @@ -85,20 +84,23 @@ class LanguageFi extends Language { } /** - * @param $str string - * @param $forContent bool + * @param string $str + * @param bool $forContent * @return string */ function translateBlockExpiry( $str, $forContent = false ) { /* 'ago', 'now', 'today', 'this', 'next', - 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth', + 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', + 'tenth', 'eleventh', 'twelfth', 'tomorrow', 'yesterday' - $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' . - 'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' . - 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'. - 'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu'; + $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,' . + 'may:toukokuu,june:kesäkuu,july:heinäkuu,august:elokuu,september:syyskuu,' . + 'october:lokakuu,november:marraskuu,december:joulukuu,' . + 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,' . + 'jul:heinäkuu,aug:elokuu,sep:syyskuu,oct:lokakuu,nov:marraskuu,' . + dec:joulukuu,sept:syyskuu'; */ $weekds = array( 'monday' => 'maanantai', diff --git a/languages/classes/LanguageGa.php b/languages/classes/LanguageGa.php index 339ad4de..38c50d2e 100644 --- a/languages/classes/LanguageGa.php +++ b/languages/classes/LanguageGa.php @@ -32,8 +32,8 @@ class LanguageGa extends Language { * Convert day names * Invoked with {{GRAMMAR:transformation|word}} * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { diff --git a/languages/classes/LanguageGan.php b/languages/classes/LanguageGan.php index d81574d1..a012f594 100644 --- a/languages/classes/LanguageGan.php +++ b/languages/classes/LanguageGan.php @@ -28,27 +28,26 @@ require_once __DIR__ . '/LanguageZh.php'; * @ingroup Language */ class GanConverter extends LanguageConverter { - /** - * @param $langobj Language - * @param $maincode string - * @param $variants array - * @param $variantfallbacks array - * @param $flags array - * @param $manualLevel array + * @param Language $langobj + * @param string $maincode + * @param array $variants + * @param array $variantfallbacks + * @param array $flags + * @param array $manualLevel */ function __construct( $langobj, $maincode, - $variants = array(), - $variantfallbacks = array(), - $flags = array(), - $manualLevel = array() ) { + $variants = array(), + $variantfallbacks = array(), + $flags = array(), + $manualLevel = array() ) { $this->mDescCodeSep = ':'; $this->mDescVarSep = ';'; parent::__construct( $langobj, $maincode, - $variants, - $variantfallbacks, - $flags, - $manualLevel ); + $variants, + $variantfallbacks, + $flags, + $manualLevel ); $names = array( 'gan' => '原文', 'gan-hans' => '简体', @@ -67,8 +66,8 @@ class GanConverter extends LanguageConverter { } /** - * @param $key string - * @return String + * @param string $key + * @return string */ function convertCategoryKey( $key ) { return $this->autoConvert( $key, 'gan' ); @@ -82,7 +81,6 @@ class GanConverter extends LanguageConverter { * @ingroup Language */ class LanguageGan extends LanguageZh { - function __construct() { global $wgHooks; parent::__construct(); @@ -98,9 +96,9 @@ class LanguageGan extends LanguageZh { ); $this->mConverter = new GanConverter( $this, 'gan', - $variants, $variantfallbacks, - array(), - $ml ); + $variants, $variantfallbacks, + array(), + $ml ); $wgHooks['PageContentSaveComplete'][] = $this->mConverter; } @@ -108,9 +106,9 @@ class LanguageGan extends LanguageZh { /** * word segmentation * - * @param $string string - * @param $autoVariant string - * @return String + * @param string $string + * @param string $autoVariant + * @return string */ function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) { // LanguageZh::normalizeForSearch diff --git a/languages/classes/LanguageHe.php b/languages/classes/LanguageHe.php index 03919886..a6aaf6db 100644 --- a/languages/classes/LanguageHe.php +++ b/languages/classes/LanguageHe.php @@ -35,8 +35,8 @@ class LanguageHe extends Language { * Available cases: * "prefixed" (or "תחילית") - when the word has a prefix * - * @param $word String: the word to convert - * @param $case String: the case + * @param string $word The word to convert + * @param string $case The case * * @return string */ diff --git a/languages/classes/LanguageHsb.php b/languages/classes/LanguageHsb.php index 5623f3ce..a862d42e 100644 --- a/languages/classes/LanguageHsb.php +++ b/languages/classes/LanguageHsb.php @@ -27,13 +27,12 @@ * @ingroup Language */ class LanguageHsb 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,9 +48,10 @@ class LanguageHsb extends Language { case 'lokatiw': # lokatiw $word = 'wo ' . $word; break; - } + } - return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values + # this will return the original value for 'nominatiw' (nominativ) and + # all undefined case values. + return $word; } - } diff --git a/languages/classes/LanguageHu.php b/languages/classes/LanguageHu.php index 1f4d45c0..bbf3b055 100644 --- a/languages/classes/LanguageHu.php +++ b/languages/classes/LanguageHu.php @@ -29,8 +29,8 @@ class LanguageHu extends Language { /** - * @param $word string - * @param $case + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index 24068296..b7767eb3 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 ) { @@ -82,7 +82,7 @@ class LanguageHy extends Language { /** * Armenian numeric format is "12 345,67" but "1234,56" * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageIu.php b/languages/classes/LanguageIu.php index abd2e7c8..db3a22ca 100644 --- a/languages/classes/LanguageIu.php +++ b/languages/classes/LanguageIu.php @@ -36,26 +36,27 @@ require_once __DIR__ . '/../LanguageConverter.php'; * @ingroup Language */ class IuConverter extends LanguageConverter { - protected $mDoContentConvert; + public $mToLatin = array( - 'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa', - 'ᑉ' => 'p', 'ᐱ' => 'pi', 'ᐲ' => 'pii', 'ᐳ' => 'pu', 'ᐴ' => 'puu', 'ᐸ' => 'pa', 'ᐹ' => 'paa', - 'ᑦ' => 't', 'ᑎ' => 'ti', 'ᑏ' => 'tii', 'ᑐ' => 'tu', 'ᑑ' => 'tuu', 'ᑕ' => 'ta', 'ᑖ' => 'taa', - 'ᒃ' => 'k', 'ᑭ' => 'ki', 'ᑮ' => 'kii', 'ᑯ' => 'ku', 'ᑰ' => 'kuu', 'ᑲ' => 'ka', 'ᑳ' => 'kaa', - 'ᖅᒃ' => 'qq', 'ᖅᑭ' => 'qqi', 'ᖅᑮ' => 'qqii', 'ᖅᑯ' => 'qqu', 'ᖅᑰ' => 'ᖅqquu', 'ᖅᑲ' => 'qqa', 'ᖅᑳ' => 'qqaa', - 'ᒡ' => 'g', 'ᒋ' => 'gi', 'ᒌ' => 'gii', 'ᒍ' => 'gu', 'ᒎ' => 'guu', 'ᒐ' => 'ga', 'ᒑ' => 'gaa', - 'ᒻ' => 'm', 'ᒥ' => 'mi', 'ᒦ' => 'mii', 'ᒧ' => 'mu', 'ᒨ' => 'muu', 'ᒪ' => 'ma', 'ᒫ' => 'maa', - 'ᓐ' => 'n', 'ᓂ' => 'ni', 'ᓃ' => 'nii', 'ᓄ' => 'nu', 'ᓅ' => 'nuu', 'ᓇ' => 'na', 'ᓈ' => 'naa', - 'ᔅ' => 's', 'ᓯ' => 'si', 'ᓰ' => 'sii', 'ᓱ' => 'su', 'ᓲ' => 'suu', 'ᓴ' => 'sa', 'ᓵ' => 'saa', - 'ᓪ' => 'l', 'ᓕ' => 'li', 'ᓖ' => 'lii', 'ᓗ' => 'lu', 'ᓘ' => 'luu', 'ᓚ' => 'la', 'ᓛ' => 'laa', - 'ᔾ' => 'j', 'ᔨ' => 'ji', 'ᔩ' => 'jii', 'ᔪ' => 'ju', 'ᔫ' => 'juu', 'ᔭ' => 'ja', 'ᔮ' => 'jaa', - 'ᕝ' => 'v', 'ᕕ' => 'vi', 'ᕖ' => 'vii', 'ᕗ' => 'vu', 'ᕘ' => 'vuu', 'ᕙ' => 'va', 'ᕚ' => 'vaa', - 'ᕐ' => 'r', 'ᕆ' => 'ri', 'ᕇ' => 'rii', 'ᕈ' => 'ru', 'ᕉ' => 'ruu', 'ᕋ' => 'ra', 'ᕌ' => 'raa', - 'ᖅ' => 'q', 'ᕿ' => 'qi', 'ᖀ' => 'qii', 'ᖁ' => 'qu', 'ᖂ' => 'quu', 'ᖃ' => 'qa', 'ᖄ' => 'qaa', - 'ᖕ' => 'ng', 'ᖏ' => 'ngi', 'ᖐ' => 'ngii', 'ᖑ' => 'ngu', 'ᖒ' => 'nguu', 'ᖓ' => 'nga', 'ᖔ' => 'ngaa', - 'ᖖ' => 'nng', 'ᙱ' => 'nngi', 'ᙲ' => 'nngii', 'ᙳ' => 'nngu', 'ᙴ' => 'nnguu', 'ᙵ' => 'nnga', 'ᙶ' => 'nngaa', - 'ᖦ' => 'ɫ', 'ᖠ' => 'ɫi', 'ᖡ' => 'ɫii', 'ᖢ' => 'ɫu', 'ᖣ' => 'ɫuu', 'ᖤ' => 'ɫa', 'ᖥ' => 'ɫaa', + 'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa', + 'ᑉ' => 'p', 'ᐱ' => 'pi', 'ᐲ' => 'pii', 'ᐳ' => 'pu', 'ᐴ' => 'puu', 'ᐸ' => 'pa', 'ᐹ' => 'paa', + 'ᑦ' => 't', 'ᑎ' => 'ti', 'ᑏ' => 'tii', 'ᑐ' => 'tu', 'ᑑ' => 'tuu', 'ᑕ' => 'ta', 'ᑖ' => 'taa', + 'ᒃ' => 'k', 'ᑭ' => 'ki', 'ᑮ' => 'kii', 'ᑯ' => 'ku', 'ᑰ' => 'kuu', 'ᑲ' => 'ka', 'ᑳ' => 'kaa', + 'ᖅᒃ' => 'qq', 'ᖅᑭ' => 'qqi', 'ᖅᑮ' => 'qqii', 'ᖅᑯ' => 'qqu', 'ᖅᑰ' => 'ᖅqquu', 'ᖅᑲ' => 'qqa', + 'ᖅᑳ' => 'qqaa', 'ᒡ' => 'g', 'ᒋ' => 'gi', 'ᒌ' => 'gii', 'ᒍ' => 'gu', 'ᒎ' => 'guu', + 'ᒐ' => 'ga', 'ᒑ' => 'gaa', 'ᒻ' => 'm', 'ᒥ' => 'mi', 'ᒦ' => 'mii', 'ᒧ' => 'mu', 'ᒨ' => 'muu', + 'ᒪ' => 'ma', 'ᒫ' => 'maa', 'ᓐ' => 'n', 'ᓂ' => 'ni', 'ᓃ' => 'nii', 'ᓄ' => 'nu', 'ᓅ' => 'nuu', + 'ᓇ' => 'na', 'ᓈ' => 'naa', 'ᔅ' => 's', 'ᓯ' => 'si', 'ᓰ' => 'sii', 'ᓱ' => 'su', 'ᓲ' => 'suu', + 'ᓴ' => 'sa', 'ᓵ' => 'saa', 'ᓪ' => 'l', 'ᓕ' => 'li', 'ᓖ' => 'lii', 'ᓗ' => 'lu', 'ᓘ' => 'luu', + 'ᓚ' => 'la', 'ᓛ' => 'laa', 'ᔾ' => 'j', 'ᔨ' => 'ji', 'ᔩ' => 'jii', 'ᔪ' => 'ju', 'ᔫ' => 'juu', + 'ᔭ' => 'ja', 'ᔮ' => 'jaa', 'ᕝ' => 'v', 'ᕕ' => 'vi', 'ᕖ' => 'vii', 'ᕗ' => 'vu', 'ᕘ' => 'vuu', + 'ᕙ' => 'va', 'ᕚ' => 'vaa', 'ᕐ' => 'r', 'ᕆ' => 'ri', 'ᕇ' => 'rii', 'ᕈ' => 'ru', 'ᕉ' => 'ruu', + 'ᕋ' => 'ra', 'ᕌ' => 'raa', 'ᖅ' => 'q', 'ᕿ' => 'qi', 'ᖀ' => 'qii', 'ᖁ' => 'qu', 'ᖂ' => 'quu', + 'ᖃ' => 'qa', 'ᖄ' => 'qaa', 'ᖕ' => 'ng', 'ᖏ' => 'ngi', 'ᖐ' => 'ngii', 'ᖑ' => 'ngu', + 'ᖒ' => 'nguu', 'ᖓ' => 'nga', 'ᖔ' => 'ngaa', 'ᖖ' => 'nng', 'ᙱ' => 'nngi', 'ᙲ' => 'nngii', + 'ᙳ' => 'nngu', 'ᙴ' => 'nnguu', 'ᙵ' => 'nnga', 'ᙶ' => 'nngaa', 'ᖦ' => 'ɫ', 'ᖠ' => 'ɫi', + 'ᖡ' => 'ɫii', 'ᖢ' => 'ɫu', 'ᖣ' => 'ɫuu', 'ᖤ' => 'ɫa', 'ᖥ' => 'ɫaa', ); public $mUpperToLowerCaseLatin = array( @@ -68,23 +69,24 @@ class IuConverter extends LanguageConverter { ); public $mToSyllabics = array( - 'h' => 'ᐦ', 'i' => 'ᐃ', 'ii' => 'ᐄ', 'u' => 'ᐅ', 'uu' => 'ᐆ', 'a' => 'ᐊ', 'aa' => 'ᐋ', - 'p' => 'ᑉ', 'pi' => 'ᐱ', 'pii' => 'ᐲ', 'pu' => 'ᐳ', 'puu' => 'ᐴ', 'pa' => 'ᐸ', 'paa' => 'ᐹ', - 't' => 'ᑦ', 'ti' => 'ᑎ', 'tii' => 'ᑏ', 'tu' => 'ᑐ', 'tuu' => 'ᑑ', 'ta' => 'ᑕ', 'taa' => 'ᑖ', - 'k' => 'ᒃ', 'ki' => 'ᑭ', 'kii' => 'ᑮ', 'ku' => 'ᑯ', 'kuu' => 'ᑰ', 'ka' => 'ᑲ', 'kaa' => 'ᑳ', - 'g' => 'ᒡ', 'gi' => 'ᒋ', 'gii' => 'ᒌ', 'gu' => 'ᒍ', 'guu' => 'ᒎ', 'ga' => 'ᒐ', 'gaa' => 'ᒑ', - 'm' => 'ᒻ', 'mi' => 'ᒥ', 'mii' => 'ᒦ', 'mu' => 'ᒧ', 'muu' => 'ᒨ', 'ma' => 'ᒪ', 'maa' => 'ᒫ', - 'n' => 'ᓐ', 'ni' => 'ᓂ', 'nii' => 'ᓃ', 'nu' => 'ᓄ', 'nuu' => 'ᓅ', 'na' => 'ᓇ', 'naa' => 'ᓈ', - 's' => 'ᔅ', 'si' => 'ᓯ', 'sii' => 'ᓰ', 'su' => 'ᓱ', 'suu' => 'ᓲ', 'sa' => 'ᓴ', 'saa' => 'ᓵ', - 'l' => 'ᓪ', 'li' => 'ᓕ', 'lii' => 'ᓖ', 'lu' => 'ᓗ', 'luu' => 'ᓘ', 'la' => 'ᓚ', 'laa' => 'ᓛ', - 'j' => 'ᔾ', 'ji' => 'ᔨ', 'jii' => 'ᔩ', 'ju' => 'ᔪ', 'juu' => 'ᔫ', 'ja' => 'ᔭ', 'jaa' => 'ᔮ', - 'v' => 'ᕝ', 'vi' => 'ᕕ', 'vii' => 'ᕖ', 'vu' => 'ᕗ', 'vuu' => 'ᕘ', 'va' => 'ᕙ', 'vaa' => 'ᕚ', - 'r' => 'ᕐ', 'ri' => 'ᕆ', 'rii' => 'ᕇ', 'ru' => 'ᕈ', 'ruu' => 'ᕉ', 'ra' => 'ᕋ', 'raa' => 'ᕌ', - 'qq' => 'ᖅᒃ', 'qqi' => 'ᖅᑭ', 'qqii' => 'ᖅᑮ', 'qqu' => 'ᖅᑯ', 'qquu' => 'ᖅᑰ', 'qqa' => 'ᖅᑲ', 'qqaa' => 'ᖅᑳ', - 'q' => 'ᖅ', 'qi' => 'ᕿ', 'qii' => 'ᖀ', 'qu' => 'ᖁ', 'quu' => 'ᖂ', 'qa' => 'ᖃ', 'qaa' => 'ᖄ', - 'ng' => 'ᖕ', 'ngi' => 'ᖏ', 'ngii' => 'ᖐ', 'ngu' => 'ᖑ', 'nguu' => 'ᖒ', 'nga' => 'ᖓ', 'ngaa' => 'ᖔ', - 'nng' => 'ᖖ', 'nngi' => 'ᙱ', 'nngii' => 'ᙲ', 'nngu' => 'ᙳ', 'nnguu' => 'ᙴ', 'nnga' => 'ᙵ', 'nngaa' => 'ᙶ', - 'ɫ' => 'ᖦ', 'ɫi' => 'ᖠ', 'ɫii' => 'ᖡ', 'ɫu' => 'ᖢ', 'ɫuu' => 'ᖣ', 'ɫa' => 'ᖤ', 'ɫaa' => 'ᖥ', + 'h' => 'ᐦ', 'i' => 'ᐃ', 'ii' => 'ᐄ', 'u' => 'ᐅ', 'uu' => 'ᐆ', 'a' => 'ᐊ', 'aa' => 'ᐋ', + 'p' => 'ᑉ', 'pi' => 'ᐱ', 'pii' => 'ᐲ', 'pu' => 'ᐳ', 'puu' => 'ᐴ', 'pa' => 'ᐸ', 'paa' => 'ᐹ', + 't' => 'ᑦ', 'ti' => 'ᑎ', 'tii' => 'ᑏ', 'tu' => 'ᑐ', 'tuu' => 'ᑑ', 'ta' => 'ᑕ', 'taa' => 'ᑖ', + 'k' => 'ᒃ', 'ki' => 'ᑭ', 'kii' => 'ᑮ', 'ku' => 'ᑯ', 'kuu' => 'ᑰ', 'ka' => 'ᑲ', 'kaa' => 'ᑳ', + 'g' => 'ᒡ', 'gi' => 'ᒋ', 'gii' => 'ᒌ', 'gu' => 'ᒍ', 'guu' => 'ᒎ', 'ga' => 'ᒐ', 'gaa' => 'ᒑ', + 'm' => 'ᒻ', 'mi' => 'ᒥ', 'mii' => 'ᒦ', 'mu' => 'ᒧ', 'muu' => 'ᒨ', 'ma' => 'ᒪ', 'maa' => 'ᒫ', + 'n' => 'ᓐ', 'ni' => 'ᓂ', 'nii' => 'ᓃ', 'nu' => 'ᓄ', 'nuu' => 'ᓅ', 'na' => 'ᓇ', 'naa' => 'ᓈ', + 's' => 'ᔅ', 'si' => 'ᓯ', 'sii' => 'ᓰ', 'su' => 'ᓱ', 'suu' => 'ᓲ', 'sa' => 'ᓴ', 'saa' => 'ᓵ', + 'l' => 'ᓪ', 'li' => 'ᓕ', 'lii' => 'ᓖ', 'lu' => 'ᓗ', 'luu' => 'ᓘ', 'la' => 'ᓚ', 'laa' => 'ᓛ', + 'j' => 'ᔾ', 'ji' => 'ᔨ', 'jii' => 'ᔩ', 'ju' => 'ᔪ', 'juu' => 'ᔫ', 'ja' => 'ᔭ', 'jaa' => 'ᔮ', + 'v' => 'ᕝ', 'vi' => 'ᕕ', 'vii' => 'ᕖ', 'vu' => 'ᕗ', 'vuu' => 'ᕘ', 'va' => 'ᕙ', 'vaa' => 'ᕚ', + 'r' => 'ᕐ', 'ri' => 'ᕆ', 'rii' => 'ᕇ', 'ru' => 'ᕈ', 'ruu' => 'ᕉ', 'ra' => 'ᕋ', 'raa' => 'ᕌ', + 'qq' => 'ᖅᒃ', 'qqi' => 'ᖅᑭ', 'qqii' => 'ᖅᑮ', 'qqu' => 'ᖅᑯ', 'qquu' => 'ᖅᑰ', 'qqa' => 'ᖅᑲ', + 'qqaa' => 'ᖅᑳ', 'q' => 'ᖅ', 'qi' => 'ᕿ', 'qii' => 'ᖀ', 'qu' => 'ᖁ', 'quu' => 'ᖂ', + 'qa' => 'ᖃ', 'qaa' => 'ᖄ', 'ng' => 'ᖕ', 'ngi' => 'ᖏ', 'ngii' => 'ᖐ', 'ngu' => 'ᖑ', + 'nguu' => 'ᖒ', 'nga' => 'ᖓ', 'ngaa' => 'ᖔ', 'nng' => 'ᖖ', 'nngi' => 'ᙱ', 'nngii' => 'ᙲ', + 'nngu' => 'ᙳ', 'nnguu' => 'ᙴ', 'nnga' => 'ᙵ', 'nngaa' => 'ᙶ', 'ɫ' => 'ᖦ', 'ɫi' => 'ᖠ', + 'ɫii' => 'ᖡ', 'ɫu' => 'ᖢ', 'ɫuu' => 'ᖣ', 'ɫa' => 'ᖤ', 'ɫaa' => 'ᖥ', ); function loadDefaultTables() { @@ -102,8 +104,8 @@ class IuConverter extends LanguageConverter { * update: delete all rule parsing because it's not used * currently, and just produces a couple of bugs * - * @param $rule string - * @param $flags array + * @param string $rule + * @param array $flags * @return array */ function parseManualRule( $rule, $flags = array() ) { @@ -123,12 +125,13 @@ class IuConverter extends LanguageConverter { /** * Do not convert content on talk pages * - * @param $text string - * @param $parser Parser + * @param string $text + * @param Parser $parser * @return string */ function parserConvert( $text, &$parser ) { - $this->mDoContentConvert = !( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ); + $this->mDoContentConvert = !( is_object( $parser->getTitle() ) + && $parser->getTitle()->isTalkPage() ); return parent::parserConvert( $text, $parser ); } @@ -139,9 +142,9 @@ class IuConverter extends LanguageConverter { * names as they were * - do not try to find variants for usernames * - * @param $link string - * @param $nt Title - * @param $ignoreOtherCond bool + * @param string &$link + * @param Title &$nt + * @param bool $ignoreOtherCond */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { // check for user namespace @@ -160,30 +163,10 @@ class IuConverter extends LanguageConverter { } /** - * An ugly function wrapper for parsing Image titles - * (to prevent image name conversion) - * - * @param $text string - * @param $toVariant bool - * - * @return string - */ - function autoConvert( $text, $toVariant = false ) { - global $wgTitle; - if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) { - $imagename = $wgTitle->getNsText(); - if ( preg_match( "/^$imagename:/", $text ) ) { - return $text; - } - } - return parent::autoConvert( $text, $toVariant ); - } - - /** * It translates text into variant * - * @param $text string - * @param $toVariant bool + * @param string $text + * @param bool $toVariant * * @return string */ @@ -215,7 +198,7 @@ class LanguageIu extends Language { $variants = array( 'iu', 'ike-cans', 'ike-latn' ); $variantfallbacks = array( - 'iu' => 'ike-cans', + 'iu' => 'ike-cans', 'ike-cans' => 'iu', 'ike-latn' => 'iu', ); diff --git a/languages/classes/LanguageJa.php b/languages/classes/LanguageJa.php index 9c6314c5..043b1554 100644 --- a/languages/classes/LanguageJa.php +++ b/languages/classes/LanguageJa.php @@ -29,7 +29,7 @@ class LanguageJa extends Language { /** - * @param $string string + * @param string $string * @return string */ function segmentByWord( $string ) { @@ -53,7 +53,7 @@ class LanguageJa extends Language { * Italic is not appropriate for Japanese script * Unfortunately most browsers do not recognise this, and render <em> as italic * - * @param $text string + * @param string $text * @return string */ function emphasize( $text ) { diff --git a/languages/classes/LanguageKaa.php b/languages/classes/LanguageKaa.php index 6203b4ba..eab08fe3 100644 --- a/languages/classes/LanguageKaa.php +++ b/languages/classes/LanguageKaa.php @@ -33,8 +33,8 @@ class LanguageKaa extends Language { /** * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * * @return string */ @@ -50,7 +50,7 @@ class LanguageKaa extends Language { /** * It fixes issue with ucfirst for transforming 'i' to 'İ' * - * @param $string string + * @param string $string * * @return string */ @@ -65,7 +65,7 @@ class LanguageKaa extends Language { /** * It fixes issue with lcfirst for transforming 'I' to 'ı' * - * @param $string string + * @param string $string * * @return mixed|string */ @@ -80,7 +80,7 @@ class LanguageKaa extends Language { /** * Avoid grouping whole numbers between 0 to 9999 * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php index f96b0d92..1a098180 100644 --- a/languages/classes/LanguageKk.php +++ b/languages/classes/LanguageKk.php @@ -38,15 +38,14 @@ define( 'H_HAMZA', 'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA * @ingroup Language */ class KkConverter extends LanguageConverter { - protected $mCyrl2Latn, $mLatn2Cyrl, $mCyLa2Arab; /** - * @param $langobj Language - * @param $maincode string - * @param $variants array - * @param $variantfallbacks array - * @param $flags array + * @param Language $langobj + * @param string $maincode + * @param array $variants + * @param array $variantfallbacks + * @param array $flags */ function __construct( $langobj, $maincode, $variants = array(), @@ -227,8 +226,8 @@ class KkConverter extends LanguageConverter { * update: delete all rule parsing because it's not used * currently, and just produces a couple of bugs * - * @param $rule string - * @param $flags array + * @param string $rule + * @param array $flags * @return array */ function parseManualRule( $rule, $flags = array() ) { @@ -251,8 +250,8 @@ class KkConverter extends LanguageConverter { * names as they were * - do not try to find variants for usernames * - * @param $link string - * @param $nt Title + * @param string &$link + * @param Title &$nt * @param bool $ignoreOtherCond */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { @@ -272,30 +271,10 @@ class KkConverter extends LanguageConverter { } /** - * An ugly function wrapper for parsing Image titles - * (to prevent image name conversion) - * - * @param $text string - * @param $toVariant bool - * - * @return string - */ - function autoConvert( $text, $toVariant = false ) { - global $wgTitle; - if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) { - $imagename = $wgTitle->getNsText(); - if ( preg_match( "/^$imagename:/", $text ) ) { - return $text; - } - } - return parent::autoConvert( $text, $toVariant ); - } - - /** * It translates text into variant * - * @param $text string - * @param $toVariant string + * @param string $text + * @param string $toVariant * * @return string */ @@ -326,20 +305,28 @@ class KkConverter extends LanguageConverter { // disable conversion variables like $1, $2... $varsfix = '\$[0-9]'; - $matches = preg_split( '/' . $varsfix . '[^' . $letters . ']+/u', $text, -1, PREG_SPLIT_OFFSET_CAPTURE ); + $matches = preg_split( + '/' . $varsfix . '[^' . $letters . ']+/u', + $text, + -1, + PREG_SPLIT_OFFSET_CAPTURE + ); + $mstart = 0; $ret = ''; + foreach ( $matches as $m ) { $ret .= substr( $text, $mstart, $m[1] -$mstart ); $ret .= $this->regsConverter( $m[0], $toVariant ); $mstart = $m[1] + strlen( $m[0] ); } + return $ret; } /** - * @param $text string - * @param $toVariant string + * @param string $text + * @param string $toVariant * @return mixed|string */ function regsConverter( $text, $toVariant ) { @@ -350,9 +337,9 @@ class KkConverter extends LanguageConverter { switch ( $toVariant ) { case 'kk-arab': case 'kk-cn': - $letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/; - $front = 'әөүіӘӨҮІ'/*.'äöüiÄÖÜİ'*/; - $excludes = 'еэгғкқЕЭГҒКҚ'/*.'eégğkqEÉGĞKQ'*/; + $letters = KK_C_LC . KK_C_UC; /*.KK_L_LC.KK_L_UC*/ + $front = 'әөүіӘӨҮІ'; /*.'äöüiÄÖÜİ'*/ + $excludes = 'еэгғкқЕЭГҒКҚ'; /*.'eégğkqEÉGĞKQ'*/ // split text to words $matches = preg_split( '/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE ); $mstart = 0; @@ -362,7 +349,9 @@ class KkConverter extends LanguageConverter { // is matched the word to front vowels? // exclude a words matched to е, э, г, к, к, қ, // them should be without hamza - if ( preg_match( '/[' . $front . ']/u', $m[0] ) && !preg_match( '/[' . $excludes . ']/u', $m[0] ) ) { + if ( preg_match( '/[' . $front . ']/u', $m[0] ) + && !preg_match( '/[' . $excludes . ']/u', $m[0] ) + ) { $ret .= preg_replace( '/[' . $letters . ']+/u', H_HAMZA . '$0', $m[0] ); } else { $ret .= $m[0]; @@ -395,13 +384,12 @@ class KkConverter extends LanguageConverter { } /** - * @param $key string - * @return String + * @param string $key + * @return string */ function convertCategoryKey( $key ) { return $this->autoConvert( $key, 'kk' ); } - } /** @@ -411,7 +399,6 @@ class KkConverter extends LanguageConverter { * @ingroup Language */ class LanguageKk extends LanguageKk_cyrl { - function __construct() { global $wgHooks; parent::__construct(); @@ -435,7 +422,7 @@ class LanguageKk extends LanguageKk_cyrl { /** * It fixes issue with ucfirst for transforming 'i' to 'İ' * - * @param $string string + * @param string $string * * @return string */ @@ -452,7 +439,7 @@ class LanguageKk extends LanguageKk_cyrl { /** * It fixes issue with lcfirst for transforming 'I' to 'ı' * - * @param $string string + * @param string $string * * @return string */ @@ -467,8 +454,8 @@ class LanguageKk extends LanguageKk_cyrl { } /** - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { diff --git a/languages/classes/LanguageKk_cyrl.php b/languages/classes/LanguageKk_cyrl.php index 5a7bbf36..22fe4289 100644 --- a/languages/classes/LanguageKk_cyrl.php +++ b/languages/classes/LanguageKk_cyrl.php @@ -26,15 +26,16 @@ * * @ingroup Language */ +// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error class LanguageKk_cyrl extends Language { - + // @codingStandardsIgnoreEnd # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} /** * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * * @return string */ @@ -203,7 +204,10 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "тан"; } - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Sonants ) + || in_array( $wordEnding, $Sibilants ) + ) { if ( in_array( $wordLastVowel, $frontVowels ) ) { $word = $word . "ден"; } elseif ( in_array( $wordLastVowel, $backVowels ) ) { @@ -237,7 +241,10 @@ class LanguageKk_cyrl extends Language { case "comitative": # kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "пен"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "мен"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "бен"; @@ -247,7 +254,10 @@ class LanguageKk_cyrl extends Language { case "possessive comitative": # täweldık + kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "пенен"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "менен"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "бенен"; @@ -259,8 +269,8 @@ class LanguageKk_cyrl extends Language { } /** - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammarKk_latn( $word, $case ) { @@ -428,7 +438,10 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "tan"; } - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Sonants ) + || in_array( $wordEnding, $Sibilants ) + ) { if ( in_array( $wordLastVowel, $frontVowels ) ) { $word = $word . "den"; } elseif ( in_array( $wordLastVowel, $backVowels ) ) { @@ -462,7 +475,10 @@ class LanguageKk_cyrl extends Language { case "comitative": # kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "pen"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "men"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "ben"; @@ -472,7 +488,10 @@ class LanguageKk_cyrl extends Language { case "possessive comitative": # täweldık + kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "penen"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "menen"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "benen"; @@ -484,8 +503,8 @@ class LanguageKk_cyrl extends Language { } /** - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammarKk_arab( $word, $case ) { @@ -653,7 +672,10 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "تان"; } - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Sonants ) + || in_array( $wordEnding, $Sibilants ) + ) { if ( in_array( $wordLastVowel, $frontVowels ) ) { $word = $word . "دەن"; } elseif ( in_array( $wordLastVowel, $backVowels ) ) { @@ -687,7 +709,10 @@ class LanguageKk_cyrl extends Language { case "comitative": # kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "پەن"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "مەن"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "بەن"; @@ -697,7 +722,10 @@ class LanguageKk_cyrl extends Language { case "possessive comitative": # täweldık + kömektes if ( in_array( $wordEnding, $Consonants ) ) { $word = $word . "پەنەن"; - } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) { + } elseif ( in_array( $wordEnding, $allVowels ) + || in_array( $wordEnding, $Nasals ) + || in_array( $wordEnding, $Sonants ) + ) { $word = $word . "مەنەن"; } elseif ( in_array( $wordEnding, $Sibilants ) ) { $word = $word . "بەنەن"; @@ -709,8 +737,8 @@ class LanguageKk_cyrl extends Language { } /** - * @param $word string - * @param $allVowels array + * @param string $word + * @param array $allVowels * @return array */ function lastLetter( $word, $allVowels ) { @@ -727,7 +755,7 @@ class LanguageKk_cyrl extends Language { $lastLetter[0] = $ar[count( $ar ) - 1]; // Find the last vowel in the word - $lastLetter[1] = NULL; + $lastLetter[1] = null; foreach ( $wordReversed as $xvalue ) { foreach ( $allVowels as $yvalue ) { if ( strcmp( $xvalue, $yvalue ) == 0 ) { @@ -737,7 +765,7 @@ class LanguageKk_cyrl extends Language { continue; } } - if ( $lastLetter[1] !== NULL ) { + if ( $lastLetter[1] !== null ) { break; } else { continue; @@ -750,7 +778,7 @@ class LanguageKk_cyrl extends Language { /** * Avoid grouping whole numbers between 0 to 9999 * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageKm.php b/languages/classes/LanguageKm.php index 71d67a76..1e0bb004 100644 --- a/languages/classes/LanguageKm.php +++ b/languages/classes/LanguageKm.php @@ -30,7 +30,7 @@ class LanguageKm extends Language { /** - * @param $_ string + * @param string $_ * @return string */ function commafy( $_ ) { diff --git a/languages/classes/LanguageKsh.php b/languages/classes/LanguageKsh.php index d25ce714..6b6c95d1 100644 --- a/languages/classes/LanguageKsh.php +++ b/languages/classes/LanguageKsh.php @@ -28,7 +28,7 @@ * @ingroup Language */ class LanguageKsh extends Language { - static $familygender = array( + private static $familygender = array( // Do not add male wiki families, since that's the default. // No need add neuter wikis having names ending in -wiki. 'wikipedia' => 'f', @@ -83,8 +83,8 @@ class LanguageKsh extends Language { * Contents of the leftmost table column can be copied and pasted as * "case" values. * - * @param $word String - * @param $case String + * @param string $word + * @param string $case * * @return string */ @@ -168,7 +168,7 @@ class LanguageKsh extends Language { /** * Avoid grouping whole numbers between 0 to 9999 * - * @param $_ string + * @param string $_ * * @return string */ @@ -183,8 +183,8 @@ class LanguageKsh extends Language { /** * Handle cases of (1, other, 0) or (1, other) * - * @param $count int - * @param $forms array + * @param int $count + * @param array $forms * * @return string */ diff --git a/languages/classes/LanguageKu.php b/languages/classes/LanguageKu.php index 75ac1c77..1fdebc27 100644 --- a/languages/classes/LanguageKu.php +++ b/languages/classes/LanguageKu.php @@ -127,7 +127,8 @@ class KuConverter extends LanguageConverter { ' O' => 'ئۆ ', ' U' => 'ئو ', ' Û' => 'ئوو ', - # eyn erstmal deaktivieren, einfache Anführungsstriche sind einfach zu häufig, um sie als eyn zu interpretieren + # eyn erstmal deaktivieren, einfache Anführungsstriche sind einfach zu + # häufig, um sie als eyn zu interpretieren. # '\'' => 'ع', /* # deactivated for now, breaks links i.e. in header of Special:Recentchanges :-( @@ -159,9 +160,9 @@ class KuConverter extends LanguageConverter { * names as they were * - do not try to find variants for usernames * - * @param $link string - * @param $nt Title - * @param $ignoreOtherCond bool + * @param string &$link + * @param Title &$nt + * @param bool $ignoreOtherCond */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { // check for user namespace @@ -180,31 +181,11 @@ class KuConverter extends LanguageConverter { } /** - * An ugly function wrapper for parsing Image titles - * (to prevent image name conversion) - * - * @param $text string - * @param $toVariant bool - * - * @return string - */ - function autoConvert( $text, $toVariant = false ) { - global $wgTitle; - if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) { - $imagename = $wgTitle->getNsText(); - if ( preg_match( "/^$imagename:/", $text ) ) { - return $text; - } - } - return parent::autoConvert( $text, $toVariant ); - } - - /** * It translates text into variant, specials: * - ommiting roman numbers * - * @param $text string - * @param $toVariant bool + * @param string $text + * @param bool $toVariant * * @throws MWException * @return string diff --git a/languages/classes/LanguageKu_ku.php b/languages/classes/LanguageKu_ku.php index 2381de53..e745965a 100644 --- a/languages/classes/LanguageKu_ku.php +++ b/languages/classes/LanguageKu_ku.php @@ -26,12 +26,13 @@ * * @ingroup Language */ +// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error class LanguageKu_ku extends Language { - + // @codingStandardsIgnoreEnd /** * Avoid grouping whole numbers between 0 to 9999 * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageLa.php b/languages/classes/LanguageLa.php index 9c778782..e2dea1d9 100644 --- a/languages/classes/LanguageLa.php +++ b/languages/classes/LanguageLa.php @@ -35,8 +35,8 @@ class LanguageLa extends Language { * * Cases: genitive, accusative, ablative * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * * @return string */ diff --git a/languages/classes/LanguageMl.php b/languages/classes/LanguageMl.php index ec3ea541..cd39378b 100644 --- a/languages/classes/LanguageMl.php +++ b/languages/classes/LanguageMl.php @@ -37,7 +37,7 @@ class LanguageMl extends Language { * @todo FIXME: This is language-specific for now only to avoid the negative * performance impact of enabling it for all languages. * - * @param $s string + * @param string $s * * @return string */ diff --git a/languages/classes/LanguageMy.php b/languages/classes/LanguageMy.php index 1d117dd6..236ae4f5 100644 --- a/languages/classes/LanguageMy.php +++ b/languages/classes/LanguageMy.php @@ -30,7 +30,7 @@ class LanguageMy extends Language { /** - * @param $_ string + * @param string $_ * @return string */ function commafy( $_ ) { diff --git a/languages/classes/LanguageOs.php b/languages/classes/LanguageOs.php index f37e2d54..dbf4cceb 100644 --- a/languages/classes/LanguageOs.php +++ b/languages/classes/LanguageOs.php @@ -49,8 +49,8 @@ class LanguageOs extends Language { * Then result word is: word + 'й' + case ending for cases != allative or comitative * and word + case ending for allative or comitative. Ending of allative case here is 'æ'. * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { @@ -67,7 +67,6 @@ class LanguageOs extends Language { # Variable for ending $ending = ''; - # CHecking if the $word is in plural form if ( preg_match( '/тæ$/u', $word ) ) { $word = mb_substr( $word, 0, -1 ); diff --git a/languages/classes/LanguagePl.php b/languages/classes/LanguagePl.php index 8e286c94..e0bf0690 100644 --- a/languages/classes/LanguagePl.php +++ b/languages/classes/LanguagePl.php @@ -28,7 +28,7 @@ */ class LanguagePl extends Language { /** - * @param $_ string + * @param string $_ * @return string */ function commafy( $_ ) { diff --git a/languages/classes/LanguageQqx.php b/languages/classes/LanguageQqx.php index 9d92834d..1ee398de 100644 --- a/languages/classes/LanguageQqx.php +++ b/languages/classes/LanguageQqx.php @@ -32,7 +32,7 @@ */ class LanguageQqx extends Language { /** - * @param $key string + * @param string $key * @return string */ function getMessage( $key ) { diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php index d3ac1d22..226e313e 100644 --- a/languages/classes/LanguageRu.php +++ b/languages/classes/LanguageRu.php @@ -34,8 +34,8 @@ class LanguageRu 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 ) { @@ -65,6 +65,8 @@ class LanguageRu extends Language { $word = join( '', array_slice( $chars[0], 0, -2 ) ) . 'тей'; } elseif ( join( '', array_slice( $chars[0], -2 ) ) === 'ды' ) { $word = join( '', array_slice( $chars[0], 0, -2 ) ) . 'дов'; + } elseif ( join( '', array_slice( $chars[0], -1 ) ) === 'д' ) { + $word = join( '', array_slice( $chars[0], 0, -1 ) ) . 'да'; } elseif ( join( '', array_slice( $chars[0], -3 ) ) === 'ник' ) { $word = join( '', array_slice( $chars[0], 0, -3 ) ) . 'ника'; } elseif ( join( '', array_slice( $chars[0], -3 ) ) === 'ные' ) { @@ -91,6 +93,8 @@ class LanguageRu extends Language { $word = join( '', array_slice( $chars[0], 0, -2 ) ) . 'тях'; } elseif ( join( '', array_slice( $chars[0], -2 ) ) === 'ды' ) { $word = join( '', array_slice( $chars[0], 0, -2 ) ) . 'дах'; + } elseif ( join( '', array_slice( $chars[0], -1 ) ) === 'д' ) { + $word = join( '', array_slice( $chars[0], 0, -1 ) ) . 'де'; } elseif ( join( '', array_slice( $chars[0], -3 ) ) === 'ник' ) { $word = join( '', array_slice( $chars[0], 0, -3 ) ) . 'нике'; } elseif ( join( '', array_slice( $chars[0], -3 ) ) === 'ные' ) { @@ -108,7 +112,7 @@ class LanguageRu extends Language { * See manual of style at http://ru.wikipedia.org/wiki/Википедия:Оформление_статей * So "1 234 567", "12 345" but "1234" * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageShi.php b/languages/classes/LanguageShi.php index f4180cb8..105a3af7 100644 --- a/languages/classes/LanguageShi.php +++ b/languages/classes/LanguageShi.php @@ -36,7 +36,6 @@ require_once __DIR__ . '/../LanguageConverter.php'; * @ingroup Language */ class ShiConverter extends LanguageConverter { - protected $mDoContentConvert; public $mToLatin = array( @@ -81,8 +80,8 @@ class ShiConverter extends LanguageConverter { * update: delete all rule parsing because it's not used * currently, and just produces a couple of bugs * - * @param $rule string - * @param $flags array + * @param string $rule + * @param array $flags * @return array */ function parseManualRule( $rule, $flags = array() ) { @@ -102,12 +101,13 @@ class ShiConverter extends LanguageConverter { /** * Do not convert content on talk pages * - * @param $text string - * @param $parser Parser + * @param string $text + * @param Parser $parser * @return string */ function parserConvert( $text, &$parser ) { - $this->mDoContentConvert = !( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() ); + $this->mDoContentConvert = !( is_object( $parser->getTitle() ) + && $parser->getTitle()->isTalkPage() ); return parent::parserConvert( $text, $parser ); } @@ -118,9 +118,9 @@ class ShiConverter extends LanguageConverter { * names as they were * - do not try to find variants for usernames * - * @param $link string - * @param $nt Title - * @param $ignoreOtherCond bool + * @param string &$link + * @param Title &$nt + * @param bool $ignoreOtherCond */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { // check for user namespace @@ -139,30 +139,10 @@ class ShiConverter extends LanguageConverter { } /** - * An ugly function wrapper for parsing Image titles - * (to prevent image name conversion) - * - * @param $text string - * @param $toVariant bool - * - * @return string - */ - function autoConvert( $text, $toVariant = false ) { - global $wgTitle; - if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) { - $imagename = $wgTitle->getNsText(); - if ( preg_match( "/^$imagename:/", $text ) ) { - return $text; - } - } - return parent::autoConvert( $text, $toVariant ); - } - - /** * It translates text into variant * - * @param $text string - * @param $toVariant string + * @param string $text + * @param string $toVariant * * @return string */ diff --git a/languages/classes/LanguageSl.php b/languages/classes/LanguageSl.php index 06c75c95..25fc9631 100644 --- a/languages/classes/LanguageSl.php +++ b/languages/classes/LanguageSl.php @@ -32,8 +32,8 @@ class LanguageSl extends Language { /** * Cases: rodilnik, dajalnik, tožilnik, mestnik, orodnik * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * * @return string */ @@ -52,7 +52,8 @@ class LanguageSl extends Language { break; } - return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values + # this will return the original value for 'imenovalnik' (nominativ) and + # all undefined case values. + return $word; } - } diff --git a/languages/classes/LanguageSr.php b/languages/classes/LanguageSr.php index 76cd8229..bdf1ec41 100644 --- a/languages/classes/LanguageSr.php +++ b/languages/classes/LanguageSr.php @@ -34,35 +34,35 @@ require_once __DIR__ . '/../LanguageConverter.php'; */ class SrConverter extends LanguageConverter { public $mToLatin = array( - 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', - 'ђ' => 'đ', 'е' => 'e', 'ж' => 'ž', 'з' => 'z', 'и' => 'i', - 'ј' => 'j', 'к' => 'k', 'л' => 'l', 'љ' => 'lj', 'м' => 'm', - 'н' => 'n', 'њ' => 'nj', 'о' => 'o', 'п' => 'p', 'р' => 'r', - 'с' => 's', 'т' => 't', 'ћ' => 'ć', 'у' => 'u', 'ф' => 'f', - 'х' => 'h', 'ц' => 'c', 'ч' => 'č', 'џ' => 'dž', 'ш' => 'š', - - 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', - 'Ђ' => 'Đ', 'Е' => 'E', 'Ж' => 'Ž', 'З' => 'Z', 'И' => 'I', - 'Ј' => 'J', 'К' => 'K', 'Л' => 'L', 'Љ' => 'Lj', 'М' => 'M', - 'Н' => 'N', 'Њ' => 'Nj', 'О' => 'O', 'П' => 'P', 'Р' => 'R', - 'С' => 'S', 'Т' => 'T', 'Ћ' => 'Ć', 'У' => 'U', 'Ф' => 'F', - 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Č', 'Џ' => 'Dž', 'Ш' => 'Š', + 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', + 'ђ' => 'đ', 'е' => 'e', 'ж' => 'ž', 'з' => 'z', 'и' => 'i', + 'ј' => 'j', 'к' => 'k', 'л' => 'l', 'љ' => 'lj', 'м' => 'm', + 'н' => 'n', 'њ' => 'nj', 'о' => 'o', 'п' => 'p', 'р' => 'r', + 'с' => 's', 'т' => 't', 'ћ' => 'ć', 'у' => 'u', 'ф' => 'f', + 'х' => 'h', 'ц' => 'c', 'ч' => 'č', 'џ' => 'dž', 'ш' => 'š', + + 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', + 'Ђ' => 'Đ', 'Е' => 'E', 'Ж' => 'Ž', 'З' => 'Z', 'И' => 'I', + 'Ј' => 'J', 'К' => 'K', 'Л' => 'L', 'Љ' => 'Lj', 'М' => 'M', + 'Н' => 'N', 'Њ' => 'Nj', 'О' => 'O', 'П' => 'P', 'Р' => 'R', + 'С' => 'S', 'Т' => 'T', 'Ћ' => 'Ć', 'У' => 'U', 'Ф' => 'F', + 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Č', 'Џ' => 'Dž', 'Ш' => 'Š', ); public $mToCyrillics = array( - 'a' => 'а', 'b' => 'б', 'c' => 'ц', 'č' => 'ч', 'ć' => 'ћ', - 'd' => 'д', 'dž' => 'џ', 'đ' => 'ђ', 'e' => 'е', 'f' => 'ф', - 'g' => 'г', 'h' => 'х', 'i' => 'и', 'j' => 'ј', 'k' => 'к', + 'a' => 'а', 'b' => 'б', 'c' => 'ц', 'č' => 'ч', 'ć' => 'ћ', + 'd' => 'д', 'dž' => 'џ', 'đ' => 'ђ', 'e' => 'е', 'f' => 'ф', + 'g' => 'г', 'h' => 'х', 'i' => 'и', 'j' => 'ј', 'k' => 'к', 'l' => 'л', 'lj' => 'љ', 'm' => 'м', 'n' => 'н', 'nj' => 'њ', - 'o' => 'о', 'p' => 'п', 'r' => 'р', 's' => 'с', 'š' => 'ш', - 't' => 'т', 'u' => 'у', 'v' => 'в', 'z' => 'з', 'ž' => 'ж', + 'o' => 'о', 'p' => 'п', 'r' => 'р', 's' => 'с', 'š' => 'ш', + 't' => 'т', 'u' => 'у', 'v' => 'в', 'z' => 'з', 'ž' => 'ж', - 'A' => 'А', 'B' => 'Б', 'C' => 'Ц', 'Č' => 'Ч', 'Ć' => 'Ћ', - 'D' => 'Д', 'Dž' => 'Џ', 'Đ' => 'Ђ', 'E' => 'Е', 'F' => 'Ф', - 'G' => 'Г', 'H' => 'Х', 'I' => 'И', 'J' => 'Ј', 'K' => 'К', + 'A' => 'А', 'B' => 'Б', 'C' => 'Ц', 'Č' => 'Ч', 'Ć' => 'Ћ', + 'D' => 'Д', 'Dž' => 'Џ', 'Đ' => 'Ђ', 'E' => 'Е', 'F' => 'Ф', + 'G' => 'Г', 'H' => 'Х', 'I' => 'И', 'J' => 'Ј', 'K' => 'К', 'L' => 'Л', 'LJ' => 'Љ', 'M' => 'М', 'N' => 'Н', 'NJ' => 'Њ', - 'O' => 'О', 'P' => 'П', 'R' => 'Р', 'S' => 'С', 'Š' => 'Ш', - 'T' => 'Т', 'U' => 'У', 'V' => 'В', 'Z' => 'З', 'Ž' => 'Ж', + 'O' => 'О', 'P' => 'П', 'R' => 'Р', 'S' => 'С', 'Š' => 'Ш', + 'T' => 'Т', 'U' => 'У', 'V' => 'В', 'Z' => 'З', 'Ž' => 'Ж', 'DŽ' => 'Џ', 'd!ž' => 'дж', 'D!ž' => 'Дж', 'D!Ž' => 'ДЖ', 'Lj' => 'Љ', 'l!j' => 'лј', 'L!j' => 'Лј', 'L!J' => 'ЛЈ', @@ -84,8 +84,8 @@ class SrConverter extends LanguageConverter { * update: delete all rule parsing because it's not used * currently, and just produces a couple of bugs * - * @param $rule string - * @param $flags array + * @param string $rule + * @param array $flags * @return array */ function parseManualRule( $rule, $flags = array() ) { @@ -108,9 +108,9 @@ class SrConverter extends LanguageConverter { * names as they were * - do not try to find variants for usernames * - * @param $link string - * @param $nt Title - * @param $ignoreOtherCond bool + * @param string &$link + * @param Title &$nt + * @param bool $ignoreOtherCond */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { // check for user namespace @@ -129,31 +129,11 @@ class SrConverter extends LanguageConverter { } /** - * An ugly function wrapper for parsing Image titles - * (to prevent image name conversion) - * - * @param $text string - * @param $toVariant bool - * - * @return string - */ - function autoConvert( $text, $toVariant = false ) { - global $wgTitle; - if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) { - $imagename = $wgTitle->getNsText(); - if ( preg_match( "/^$imagename:/", $text ) ) { - return $text; - } - } - return parent::autoConvert( $text, $toVariant ); - } - - /** * It translates text into variant, specials: * - ommiting roman numbers * - * @param $text string - * @param $toVariant string + * @param string $text + * @param string $toVariant * * @throws MWException * @return string @@ -190,9 +170,9 @@ class SrConverter extends LanguageConverter { * Guess if a text is written in Cyrillic or Latin. * Overrides LanguageConverter::guessVariant() * - * @param string $text The text to be checked - * @param string $variant Language code of the variant to be checked for - * @return bool true if $text appears to be written in $variant + * @param string $text The text to be checked + * @param string $variant Language code of the variant to be checked for + * @return bool True if $text appears to be written in $variant * * @author Nikola Smolenski <smolensk@eunet.rs> * @since 1.19 diff --git a/languages/classes/LanguageTr.php b/languages/classes/LanguageTr.php index 887f05c8..8431c3ff 100644 --- a/languages/classes/LanguageTr.php +++ b/languages/classes/LanguageTr.php @@ -21,7 +21,6 @@ * @ingroup Language */ - /** * Turkish (Türkçe) * @@ -35,7 +34,7 @@ class LanguageTr extends Language { /** - * @param $string string + * @param string $string * @return string */ function ucfirst( $string ) { @@ -47,7 +46,7 @@ class LanguageTr extends Language { } /** - * @param $string string + * @param string $string * @return mixed|string */ function lcfirst( $string ) { diff --git a/languages/classes/LanguageTyv.php b/languages/classes/LanguageTyv.php index fc1e8a81..429d0a62 100644 --- a/languages/classes/LanguageTyv.php +++ b/languages/classes/LanguageTyv.php @@ -33,8 +33,8 @@ class LanguageTyv extends Language { * Grammatical transformations, needed for inflected languages * Invoked by putting {{grammar:case|word}} in a message * - * @param $word string - * @param $case string + * @param string $word + * @param string $case * @return string */ function convertGrammar( $word, $case ) { @@ -44,7 +44,8 @@ class LanguageTyv extends Language { } // Set up some constants... - $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y" ); + $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", + "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y" ); $frontVowels = array( "е", "и", "э", "ө", "ү", "e", "i", "ö", "ü" ); $backVowels = array( "а", "ё", "о", "у", "ы", "ю", "я", "a", "o", "u", "y" ); $unroundFrontVowels = array( "е", "и", "э", "e", "i" ); @@ -53,7 +54,8 @@ class LanguageTyv extends Language { $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" ); //$voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" ); $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" ); - $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" ); + $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", + "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" ); $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" ); //$allSonants = array("л", "м", "н", "ң", "р", "й"); @@ -62,11 +64,14 @@ class LanguageTyv extends Language { //Put the word in a form we can play with since we're using UTF-8 preg_match_all( '/./us', $word, $ar ); - $wordEnding = $ar[0][count( $ar[0] ) - 1]; // Here's the last letter in the word - $wordReversed = array_reverse( $ar[0] ); // Here's an array with the order of the letters in the word reversed so we can find a match quicker *shrug* + // Here's the last letter in the word + $wordEnding = $ar[0][count( $ar[0] ) - 1]; + // Here's an array with the order of the letters in the word reversed so + // we can find a match quicker. *shrug* + $wordReversed = array_reverse( $ar[0] ); // Find the last vowel in the word - $wordLastVowel = NULL; + $wordLastVowel = null; foreach ( $wordReversed as $xvalue ) { foreach ( $allVowels as $yvalue ) { if ( strcmp( $xvalue, $yvalue ) == 0 ) { @@ -76,7 +81,7 @@ class LanguageTyv extends Language { continue; } } - if ( $wordLastVowel !== NULL ) { + if ( $wordLastVowel !== null ) { break; } else { continue; diff --git a/languages/classes/LanguageUk.php b/languages/classes/LanguageUk.php index 08041a92..5215da02 100644 --- a/languages/classes/LanguageUk.php +++ b/languages/classes/LanguageUk.php @@ -32,8 +32,8 @@ class LanguageUk 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 ) { @@ -51,7 +51,9 @@ class LanguageUk 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], -1 ) ) == 'ь' ) { $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'я'; } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' ) { @@ -70,7 +72,9 @@ class LanguageUk extends Language { # stub break; case 'accusative': # знахідний відмінок - 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 ) ) . 'ію'; } @@ -89,7 +93,7 @@ class LanguageUk extends Language { /** * Ukrainian numeric format is "12 345,67" but "1234,56" * - * @param $_ string + * @param string $_ * * @return string */ diff --git a/languages/classes/LanguageUz.php b/languages/classes/LanguageUz.php index aa3e4f24..985de68e 100644 --- a/languages/classes/LanguageUz.php +++ b/languages/classes/LanguageUz.php @@ -54,7 +54,8 @@ class UzConverter extends LanguageConverter { 'ф' => 'f', 'Ф' => 'F', 'ц' => 'c', 'Ц' => 'C', 'ў' => 'oʻ', 'Ў' => 'Oʻ', - 'ц' => 'ts', 'Ц' => 'Ts', // note: at the beginning of a word and right after a consonant, only "s" is used + // note: at the beginning of a word and right after a consonant, only "s" is used + 'ц' => 'ts', 'Ц' => 'Ts', 'қ' => 'q', 'Қ' => 'Q', 'ё' => 'yo', 'Ё' => 'Yo', 'ю' => 'yu', 'Ю' => 'Yu', @@ -69,9 +70,9 @@ class UzConverter extends LanguageConverter { 'a' => 'а', 'A' => 'А', 'b' => 'б', 'B' => 'Б', 'd' => 'д', 'D' => 'Д', - 'e' => 'е', 'E' => 'Е', - ' e' => ' э', ' E' => ' Э', // "э" is used at the beginning of a word instead of "e" - 'ye' => 'е', 'Ye' => 'Е', + // at the beginning of a word and after a vowel, "э" is used instead of "e" + // (see regex below) + 'e' => 'э', 'E' => 'Э', 'f' => 'ф', 'F' => 'Ф', 'g' => 'г', 'G' => 'Г', 'g‘' => 'ғ', 'G‘' => 'Ғ', 'gʻ' => 'ғ', 'Gʻ' => 'Ғ', @@ -112,6 +113,18 @@ class UzConverter extends LanguageConverter { ); } + function translate( $text, $toVariant ) { + if ( $toVariant == 'uz-cyrl' ) { + $text = str_replace( 'ye', 'е', $text ); + $text = str_replace( 'Ye', 'Е', $text ); + $text = str_replace( 'YE', 'Е', $text ); + // "е" after consonants, otherwise "э" (see above) + $text = preg_replace( '/([BVGDJZYKLMNPRSTFXCWQʻ‘H])E/u', '$1Е', $text ); + $text = preg_replace( '/([bvgdjzyklmnprstfxcwqʻ‘h])e/ui', '$1е', $text ); + } + return parent::translate( $text, $toVariant ); + } + } /** diff --git a/languages/classes/LanguageWa.php b/languages/classes/LanguageWa.php index e5f7438f..98d138db 100644 --- a/languages/classes/LanguageWa.php +++ b/languages/classes/LanguageWa.php @@ -36,10 +36,10 @@ class LanguageWa extends Language { * "<day> di <monthname>" for months starting by a consoun, and * "<day> d' <monthname>" for months starting with a vowel * - * @param $ts string - * @param $adj bool - * @param $format bool - * @param $tc bool + * @param string $ts + * @param bool $adj + * @param bool $format + * @param bool $tc * @return string */ function date( $ts, $adj = false, $format = true, $tc = false ) { @@ -85,10 +85,10 @@ class LanguageWa extends Language { } /** - * @param $ts string - * @param $adj bool - * @param $format bool - * @param $tc bool + * @param string $ts + * @param bool $adj + * @param bool $format + * @param bool $tc * @return string */ function timeanddate( $ts, $adj = false, $format = true, $tc = false ) { diff --git a/languages/classes/LanguageYue.php b/languages/classes/LanguageYue.php index aef52151..3293cc64 100644 --- a/languages/classes/LanguageYue.php +++ b/languages/classes/LanguageYue.php @@ -40,7 +40,7 @@ class LanguageYue extends Language { * for now just treat each character as a word. * @todo FIXME: Only do this for Han characters... * - * @param $string string + * @param string $string * @return string */ function segmentByWord( $string ) { @@ -50,7 +50,7 @@ class LanguageYue extends Language { } /** - * @param $string + * @param string $string * @return string */ function normalizeForSearch( $string ) { diff --git a/languages/classes/LanguageZh.php b/languages/classes/LanguageZh.php index d4130183..67f8769b 100644 --- a/languages/classes/LanguageZh.php +++ b/languages/classes/LanguageZh.php @@ -28,14 +28,13 @@ require_once __DIR__ . '/LanguageZh_hans.php'; * @ingroup Language */ class ZhConverter extends LanguageConverter { - /** - * @param $langobj Language - * @param $maincode string - * @param $variants array - * @param $variantfallbacks array - * @param $flags array - * @param $manualLevel array + * @param Language $langobj + * @param string $maincode + * @param array $variants + * @param array $variantfallbacks + * @param array $flags + * @param array $manualLevel */ function __construct( $langobj, $maincode, $variants = array(), @@ -88,8 +87,8 @@ class ZhConverter extends LanguageConverter { } /** - * @param $key string - * @return String + * @param string $key + * @return string */ function convertCategoryKey( $key ) { return $this->autoConvert( $key, 'zh' ); @@ -103,12 +102,22 @@ class ZhConverter extends LanguageConverter { * @ingroup Language */ class LanguageZh extends LanguageZh_hans { - function __construct() { global $wgHooks; + parent::__construct(); - $variants = array( 'zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-hk', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw' ); + $variants = array( + 'zh', + 'zh-hans', + 'zh-hant', + 'zh-cn', + 'zh-hk', + 'zh-mo', + 'zh-my', + 'zh-sg', + 'zh-tw' + ); $variantfallbacks = array( 'zh' => array( 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', 'zh-my' ), @@ -138,7 +147,7 @@ class LanguageZh extends LanguageZh_hans { /** * this should give much better diff info * - * @param $text string + * @param string $text * @return string */ function segmentForDiff( $text ) { @@ -146,7 +155,7 @@ class LanguageZh extends LanguageZh_hans { } /** - * @param $text string + * @param string $text * @return string */ function unsegmentForDiff( $text ) { @@ -156,9 +165,9 @@ class LanguageZh extends LanguageZh_hans { /** * auto convert to zh-hans and normalize special characters. * - * @param $string String - * @param $autoVariant String, default to 'zh-hans' - * @return String + * @param string $string + * @param string $autoVariant Defaults to 'zh-hans' + * @return string */ function normalizeForSearch( $string, $autoVariant = 'zh-hans' ) { wfProfileIn( __METHOD__ ); @@ -176,7 +185,7 @@ class LanguageZh extends LanguageZh_hans { } /** - * @param $termsArray array + * @param array $termsArray * @return array */ function convertForSearchResult( $termsArray ) { @@ -187,4 +196,3 @@ class LanguageZh extends LanguageZh_hans { return $ret; } } - diff --git a/languages/classes/LanguageZh_hans.php b/languages/classes/LanguageZh_hans.php index 3851c8fe..6483d90b 100644 --- a/languages/classes/LanguageZh_hans.php +++ b/languages/classes/LanguageZh_hans.php @@ -26,8 +26,9 @@ * * @ingroup Language */ +// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error class LanguageZh_hans extends Language { - + // @codingStandardsIgnoreEnd /** * @return bool */ @@ -40,7 +41,7 @@ class LanguageZh_hans extends Language { * for now just treat each character as a word. * @todo FIXME: Only do this for Han characters... * - * @param $string string + * @param string $string * * @return string */ @@ -51,7 +52,7 @@ class LanguageZh_hans extends Language { } /** - * @param $s + * @param string $s * @return string */ function normalizeForSearch( $s ) { @@ -71,7 +72,7 @@ class LanguageZh_hans extends Language { * * @since 1.21 * - * @param integer $seconds The amount of seconds. + * @param int $seconds The amount of seconds. * @param array $chosenIntervals The intervals to enable. * * @return string |