X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageIu.php;h=e8731dcd028b2b31de918b4150358e1b94b45349;hb=e72c8c8aa79a2cb6d6fcd34336625661b51cd9ea;hp=93cc2c81ffe483a10f530d6c38a6f7399ec47dec;hpb=f38e4d61ec113c9bb016c47b12268999980cd982;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageIu.php b/languages/classes/LanguageIu.php index 93cc2c81ff..e8731dcd02 100644 --- a/languages/classes/LanguageIu.php +++ b/languages/classes/LanguageIu.php @@ -28,7 +28,7 @@ * * * Based on: - * - http://commons.wikimedia.org/wiki/Image:Inuktitut.png + * - https://commons.wikimedia.org/wiki/Image:Inuktitut.png * - LanguageSr.php * * @ingroup Language @@ -36,7 +36,7 @@ class IuConverter extends LanguageConverter { protected $mDoContentConvert; - public $mToLatin = array( + public $mToLatin = [ 'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa', 'ᑉ' => 'p', 'ᐱ' => 'pi', 'ᐲ' => 'pii', 'ᐳ' => 'pu', 'ᐴ' => 'puu', 'ᐸ' => 'pa', 'ᐹ' => 'paa', 'ᑦ' => 't', 'ᑎ' => 'ti', 'ᑏ' => 'tii', 'ᑐ' => 'tu', 'ᑑ' => 'tuu', 'ᑕ' => 'ta', 'ᑖ' => 'taa', @@ -55,18 +55,18 @@ class IuConverter extends LanguageConverter { 'ᖒ' => 'nguu', 'ᖓ' => 'nga', 'ᖔ' => 'ngaa', 'ᖖ' => 'nng', 'ᙱ' => 'nngi', 'ᙲ' => 'nngii', 'ᙳ' => 'nngu', 'ᙴ' => 'nnguu', 'ᙵ' => 'nnga', 'ᙶ' => 'nngaa', 'ᖦ' => 'ɫ', 'ᖠ' => 'ɫi', 'ᖡ' => 'ɫii', 'ᖢ' => 'ɫu', 'ᖣ' => 'ɫuu', 'ᖤ' => 'ɫa', 'ᖥ' => 'ɫaa', - ); + ]; - public $mUpperToLowerCaseLatin = array( + public $mUpperToLowerCaseLatin = [ 'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e', 'F' => 'f', 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', 'L' => 'l', 'M' => 'm', 'N' => 'n', 'O' => 'o', 'P' => 'p', 'Q' => 'q', 'R' => 'r', 'S' => 's', 'T' => 't', 'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x', 'Y' => 'y', 'Z' => 'z', - ); + ]; - public $mToSyllabics = array( + public $mToSyllabics = [ 'h' => 'ᐦ', 'i' => 'ᐃ', 'ii' => 'ᐄ', 'u' => 'ᐅ', 'uu' => 'ᐆ', 'a' => 'ᐊ', 'aa' => 'ᐋ', 'p' => 'ᑉ', 'pi' => 'ᐱ', 'pii' => 'ᐲ', 'pu' => 'ᐳ', 'puu' => 'ᐴ', 'pa' => 'ᐸ', 'paa' => 'ᐹ', 't' => 'ᑦ', 'ti' => 'ᑎ', 'tii' => 'ᑏ', 'tu' => 'ᑐ', 'tuu' => 'ᑑ', 'ta' => 'ᑕ', 'taa' => 'ᑖ', @@ -85,53 +85,15 @@ class IuConverter extends LanguageConverter { 'nguu' => 'ᖒ', 'nga' => 'ᖓ', 'ngaa' => 'ᖔ', 'nng' => 'ᖖ', 'nngi' => 'ᙱ', 'nngii' => 'ᙲ', 'nngu' => 'ᙳ', 'nnguu' => 'ᙴ', 'nnga' => 'ᙵ', 'nngaa' => 'ᙶ', 'ɫ' => 'ᖦ', 'ɫi' => 'ᖠ', 'ɫii' => 'ᖡ', 'ɫu' => 'ᖢ', 'ɫuu' => 'ᖣ', 'ɫa' => 'ᖤ', 'ɫaa' => 'ᖥ', - ); + ]; function loadDefaultTables() { - $this->mTables = array( + $this->mTables = [ 'lowercase' => new ReplacementArray( $this->mUpperToLowerCaseLatin ), 'ike-cans' => new ReplacementArray( $this->mToSyllabics ), 'ike-latn' => new ReplacementArray( $this->mToLatin ), 'iu' => new ReplacementArray() - ); - } - - /** - * rules should be defined as -{Syllabic | Latin-} -or- - * -{code:text | code:text | ...}- - * update: delete all rule parsing because it's not used - * currently, and just produces a couple of bugs - * - * @param string $rule - * @param array $flags - * @return array - */ - function parseManualRule( $rule, $flags = array() ) { - if ( in_array( 'T', $flags ) ) { - return parent::parseManualRule( $rule, $flags ); - } - - $carray = array(); - // otherwise ignore all formatting - foreach ( $this->mVariants as $v ) { - $carray[$v] = $rule; - } - - return $carray; - } - - /** - * Do not convert content on talk pages - * - * @param string $text - * @param Parser $parser - * @return string - */ - function parserConvert( $text, &$parser ) { - $this->mDoContentConvert = !( is_object( $parser->getTitle() ) - && $parser->getTitle()->isTalkPage() ); - - return parent::parserConvert( $text, $parser ); + ]; } /** @@ -192,14 +154,14 @@ class LanguageIu extends Language { function __construct() { parent::__construct(); - $variants = array( 'iu', 'ike-cans', 'ike-latn' ); - $variantfallbacks = array( + $variants = [ 'iu', 'ike-cans', 'ike-latn' ]; + $variantfallbacks = [ 'iu' => 'ike-cans', 'ike-cans' => 'iu', 'ike-latn' => 'iu', - ); + ]; - $flags = array(); + $flags = []; $this->mConverter = new IuConverter( $this, 'iu', $variants, $variantfallbacks, $flags ); } }