MediaWiki REL1_35
GanConverter.php
Go to the documentation of this file.
1<?php
30 public function __construct( $langobj ) {
31 $this->mDescCodeSep = ':';
32 $this->mDescVarSep = ';';
33
34 $variants = [ 'gan', 'gan-hans', 'gan-hant' ];
35 $variantfallbacks = [
36 'gan' => [ 'gan-hans', 'gan-hant' ],
37 'gan-hans' => [ 'gan' ],
38 'gan-hant' => [ 'gan' ],
39 ];
40 $ml = [
41 'gan' => 'disable',
42 ];
43
44 parent::__construct( $langobj, 'gan',
45 $variants,
46 $variantfallbacks,
47 [],
48 $ml
49 );
50
51 $names = [
52 'gan' => '原文',
53 'gan-hans' => '简体',
54 'gan-hant' => '繁體',
55 ];
56 $this->mVariantNames = array_merge( $this->mVariantNames, $names );
57 }
58
59 protected function loadDefaultTables() {
60 $this->mTables = [
61 'gan-hans' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hans ),
62 'gan-hant' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hant ),
63 'gan' => new ReplacementArray
64 ];
65 }
66
71 public function convertCategoryKey( $key ) {
72 return $this->autoConvert( $key, 'gan' );
73 }
74}
convertCategoryKey( $key)
loadDefaultTables()
Load default conversion tables.
__construct( $langobj)
Base class for multi-variant language conversion.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
Wrapper around strtr() that holds replacements.
A helper class for throttling authentication attempts.