MediaWiki  1.23.0
LanguageGan.php
Go to the documentation of this file.
1 <?php
24 require_once __DIR__ . '/../LanguageConverter.php';
25 require_once __DIR__ . '/LanguageZh.php';
26 
30 class GanConverter extends LanguageConverter {
31 
40  function __construct( $langobj, $maincode,
41  $variants = array(),
42  $variantfallbacks = array(),
43  $flags = array(),
44  $manualLevel = array() ) {
45  $this->mDescCodeSep = ':';
46  $this->mDescVarSep = ';';
47  parent::__construct( $langobj, $maincode,
48  $variants,
49  $variantfallbacks,
50  $flags,
51  $manualLevel );
52  $names = array(
53  'gan' => '原文',
54  'gan-hans' => '简体',
55  'gan-hant' => '繁體',
56  );
57  $this->mVariantNames = array_merge( $this->mVariantNames, $names );
58  }
59 
60  function loadDefaultTables() {
61  require __DIR__ . '/../../includes/ZhConversion.php';
62  $this->mTables = array(
63  'gan-hans' => new ReplacementArray( $zh2Hans ),
64  'gan-hant' => new ReplacementArray( $zh2Hant ),
65  'gan' => new ReplacementArray
66  );
67  }
68 
73  function convertCategoryKey( $key ) {
74  return $this->autoConvert( $key, 'gan' );
75  }
76 }
77 
84 class LanguageGan extends LanguageZh {
85 
86  function __construct() {
88  parent::__construct();
89 
90  $variants = array( 'gan', 'gan-hans', 'gan-hant' );
91  $variantfallbacks = array(
92  'gan' => array( 'gan-hans', 'gan-hant' ),
93  'gan-hans' => array( 'gan' ),
94  'gan-hant' => array( 'gan' ),
95  );
96  $ml = array(
97  'gan' => 'disable',
98  );
99 
100  $this->mConverter = new GanConverter( $this, 'gan',
101  $variants, $variantfallbacks,
102  array(),
103  $ml );
104 
105  $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
106  }
107 
115  function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
116  // LanguageZh::normalizeForSearch
117  return parent::normalizeForSearch( $string, $autoVariant );
118  }
119 
120 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
LanguageZh
class that handles both Traditional and Simplified Chinese right now it only distinguish zh_hans,...
Definition: LanguageZh.php:105
GanConverter\loadDefaultTables
loadDefaultTables()
Definition: LanguageGan.php:60
LanguageGan\normalizeForSearch
normalizeForSearch( $string, $autoVariant='gan-hans')
word segmentation
Definition: LanguageGan.php:115
$zh2Hans
$zh2Hans
Definition: ZhConversion.php:10023
Language\$mConverter
LanguageConverter $mConverter
Definition: Language.php:78
GanConverter\convertCategoryKey
convertCategoryKey( $key)
Definition: LanguageGan.php:73
$wgHooks
$wgHooks['ArticleShow'][]
Definition: hooks.txt:110
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2113
GanConverter\__construct
__construct( $langobj, $maincode, $variants=array(), $variantfallbacks=array(), $flags=array(), $manualLevel=array())
Definition: LanguageGan.php:40
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LanguageGan\__construct
__construct()
Definition: LanguageGan.php:86
ReplacementArray
Replacement array for FSS with fallback to strtr() Supports lazy initialisation of FSS resource.
Definition: StringUtils.php:411
$zh2Hant
$zh2Hant
Definition: ZhConversion.php:11
LanguageGan
class that handles both Traditional and Simplified Chinese right now it only distinguish gan_hans,...
Definition: LanguageGan.php:84
GanConverter
Definition: LanguageGan.php:30