MediaWiki  master
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 }
GanConverter\loadDefaultTables
loadDefaultTables()
Load default conversion tables.
Definition: GanConverter.php:59
GanConverter\__construct
__construct( $langobj)
Definition: GanConverter.php:30
GanConverter\convertCategoryKey
convertCategoryKey( $key)
Definition: GanConverter.php:71
MediaWiki
A helper class for throttling authentication attempts.
ReplacementArray
Wrapper around strtr() that holds replacements.
Definition: ReplacementArray.php:24
LanguageConverter\autoConvert
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
Definition: LanguageConverter.php:396
GanConverter
Definition: GanConverter.php:26
LanguageConverter
Base class for multi-variant language conversion.
Definition: LanguageConverter.php:35