3 * Gan Chinese specific code.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
26 class GanConverter
extends LanguageConverter
{
28 * @param Language $langobj
29 * @param string $maincode
30 * @param array $variants
31 * @param array $variantfallbacks
33 * @param array $manualLevel
35 function __construct( $langobj, $maincode,
37 $variantfallbacks = [],
40 $this->mDescCodeSep
= ':';
41 $this->mDescVarSep
= ';';
42 parent
::__construct( $langobj, $maincode,
52 $this->mVariantNames
= array_merge( $this->mVariantNames
, $names );
55 function loadDefaultTables() {
57 'gan-hans' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion
::$zh2Hans ),
58 'gan-hant' => new ReplacementArray( MediaWiki\Languages\Data\ZhConversion
::$zh2Hant ),
59 'gan' => new ReplacementArray
67 function convertCategoryKey( $key ) {
68 return $this->autoConvert( $key, 'gan' );
75 * class that handles both Traditional and Simplified Chinese
76 * right now it only distinguish gan_hans, gan_hant.
80 class LanguageGan
extends LanguageZh
{
81 function __construct() {
82 parent
::__construct();
84 $variants = [ 'gan', 'gan-hans', 'gan-hant' ];
86 'gan' => [ 'gan-hans', 'gan-hant' ],
87 'gan-hans' => [ 'gan' ],
88 'gan-hant' => [ 'gan' ],
94 $this->mConverter
= new GanConverter( $this, 'gan',
95 $variants, $variantfallbacks,
103 * @param string $string
104 * @param string $autoVariant
107 function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
108 // LanguageZh::normalizeForSearch
109 return parent
::normalizeForSearch( $string, $autoVariant );