MediaWiki REL1_31
LanguageGan.php
Go to the documentation of this file.
1<?php
35 function __construct( $langobj, $maincode,
36 $variants = [],
37 $variantfallbacks = [],
38 $flags = [],
39 $manualLevel = [] ) {
40 $this->mDescCodeSep = ':';
41 $this->mDescVarSep = ';';
42 parent::__construct( $langobj, $maincode,
43 $variants,
44 $variantfallbacks,
45 $flags,
46 $manualLevel );
47 $names = [
48 'gan' => '原文',
49 'gan-hans' => '简体',
50 'gan-hant' => '繁體',
51 ];
52 $this->mVariantNames = array_merge( $this->mVariantNames, $names );
53 }
54
55 function loadDefaultTables() {
56 $this->mTables = [
57 'gan-hans' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hans ),
58 'gan-hant' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hant ),
59 'gan' => new ReplacementArray
60 ];
61 }
62
67 function convertCategoryKey( $key ) {
68 return $this->autoConvert( $key, 'gan' );
69 }
70}
71
80class LanguageGan extends LanguageZh {
81 function __construct() {
82 parent::__construct();
83
84 $variants = [ 'gan', 'gan-hans', 'gan-hant' ];
85 $variantfallbacks = [
86 'gan' => [ 'gan-hans', 'gan-hant' ],
87 'gan-hans' => [ 'gan' ],
88 'gan-hant' => [ 'gan' ],
89 ];
90 $ml = [
91 'gan' => 'disable',
92 ];
93
94 $this->mConverter = new GanConverter( $this, 'gan',
95 $variants, $variantfallbacks,
96 [],
97 $ml );
98 }
99
107 function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
108 // LanguageZh::normalizeForSearch
109 return parent::normalizeForSearch( $string, $autoVariant );
110 }
111
112}
convertCategoryKey( $key)
loadDefaultTables()
Load default conversion tables.
__construct( $langobj, $maincode, $variants=[], $variantfallbacks=[], $flags=[], $manualLevel=[])
Base class for language conversion.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
Gan Chinese.
normalizeForSearch( $string, $autoVariant='gan-hans')
word segmentation
class that handles both Traditional and Simplified Chinese right now it only distinguish zh_hans,...
Wrapper around strtr() that holds replacements.
A helper class for throttling authentication attempts.