Debian Codegraph @

includes/language/converters/WuuConverter.php

raw symbols SCIP
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21 use MediaWiki\Languages\Data\ZhConversion;
22
23 /**
24 * Wu language specific code.
25 *
26 * @ingroup Languages
27 */
28 class WuuConverter extends LanguageConverter {
29
30 public function getMainCode(): string {
31 return 'wuu';
32 }
33
34 public function getLanguageVariants(): array {
35 return [ 'wuu', 'wuu-hans', 'wuu-hant' ];
36 }
37
38 public function getVariantsFallbacks(): array {
39 return [
40 'wuu' => [ 'wuu-hans', 'wuu-hant' ],
41 'wuu-hans' => [ 'wuu' ],
42 'wuu-hant' => [ 'wuu' ],
43 ];
44 }
45
46 protected function getAdditionalManualLevel(): array {
47 return [ 'wuu' => 'disable' ];
48 }
49
50 public function getDescCodeSeparator(): string {
51 return ':';
52 }
53
54 public function getDescVarSeparator(): string {
55 return ';';
56 }
57
58 public function getVariantNames(): array {
59 $names = [
60 'wuu' => '原文',
61 'wuu-hans' => '简体',
62 'wuu-hant' => '正體',
63 ];
64 return array_merge( parent::getVariantNames(), $names );
65 }
66
67 protected function loadDefaultTables(): array {
68 return [
69 'wuu-hans' => new ReplacementArray( ZhConversion::ZH_TO_HANS ),
70 'wuu-hant' => new ReplacementArray( ZhConversion::ZH_TO_HANT ),
71 'wuu' => new ReplacementArray,
72 ];
73 }
74
75 }