MediaWiki REL1_33
LanguageGan.php
Go to the documentation of this file.
1<?php
35 function __construct( Language $langobj, $maincode,
36 $variants = [],
37 $variantfallbacks = [],
38 $flags = [],
39 $manualLevel = []
40 ) {
41 $this->mDescCodeSep = ':';
42 $this->mDescVarSep = ';';
43 parent::__construct( $langobj, $maincode,
44 $variants,
45 $variantfallbacks,
46 $flags,
47 $manualLevel
48 );
49 $names = [
50 'gan' => '原文',
51 'gan-hans' => '简体',
52 'gan-hant' => '繁體',
53 ];
54 $this->mVariantNames = array_merge( $this->mVariantNames, $names );
55 }
56
57 function loadDefaultTables() {
58 $this->mTables = [
59 'gan-hans' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hans ),
60 'gan-hant' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion::$zh2Hant ),
61 'gan' => new ReplacementArray
62 ];
63 }
64
69 function convertCategoryKey( $key ) {
70 return $this->autoConvert( $key, 'gan' );
71 }
72}
73
82class LanguageGan extends LanguageZh {
83 function __construct() {
84 parent::__construct();
85
86 $variants = [ 'gan', 'gan-hans', 'gan-hant' ];
87 $variantfallbacks = [
88 'gan' => [ 'gan-hans', 'gan-hant' ],
89 'gan-hans' => [ 'gan' ],
90 'gan-hant' => [ 'gan' ],
91 ];
92 $ml = [
93 'gan' => 'disable',
94 ];
95
96 $this->mConverter = new GanConverter( $this, 'gan',
97 $variants, $variantfallbacks,
98 [],
99 $ml
100 );
101 }
102
110 function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
111 // LanguageZh::normalizeForSearch
112 return parent::normalizeForSearch( $string, $autoVariant );
113 }
114
115}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
convertCategoryKey( $key)
loadDefaultTables()
Load default conversion tables.
__construct(Language $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,...
Internationalisation code.
Definition Language.php:36
Wrapper around strtr() that holds replacements.
A helper class for throttling authentication attempts.