Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
33.33% covered (danger)
33.33%
7 / 21
37.50% covered (danger)
37.50%
3 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
WuuConverter
33.33% covered (danger)
33.33%
7 / 21
37.50% covered (danger)
37.50%
3 / 8
26.96
0.00% covered (danger)
0.00%
0 / 1
 getMainCode
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLanguageVariants
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getVariantsFallbacks
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 getAdditionalManualLevel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDescCodeSeparator
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDescVarSeparator
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getVariantNames
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
 loadDefaultTables
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
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
21use MediaWiki\Languages\Data\ZhConversion;
22
23/**
24 * Wu language specific code.
25 *
26 * @ingroup Languages
27 */
28class 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::$zh2Hans ),
70            'wuu-hant' => new ReplacementArray( ZhConversion::$zh2Hant ),
71            'wuu' => new ReplacementArray,
72        ];
73    }
74
75}