Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
33.33% |
7 / 21 |
|
37.50% |
3 / 8 |
CRAP | |
0.00% |
0 / 1 |
WuuConverter | |
33.33% |
7 / 21 |
|
37.50% |
3 / 8 |
26.96 | |
0.00% |
0 / 1 |
getMainCode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLanguageVariants | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getVariantsFallbacks | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
getAdditionalManualLevel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDescCodeSeparator | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDescVarSeparator | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getVariantNames | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
loadDefaultTables | |
100.00% |
5 / 5 |
|
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 | |
21 | use MediaWiki\Language\LanguageConverter; |
22 | use MediaWiki\Language\ReplacementArray; |
23 | use MediaWiki\Languages\Data\ZhConversion; |
24 | |
25 | /** |
26 | * Wu language specific code. |
27 | * |
28 | * @ingroup Languages |
29 | */ |
30 | class WuuConverter extends LanguageConverter { |
31 | |
32 | public function getMainCode(): string { |
33 | return 'wuu'; |
34 | } |
35 | |
36 | public function getLanguageVariants(): array { |
37 | return [ 'wuu', 'wuu-hans', 'wuu-hant' ]; |
38 | } |
39 | |
40 | public function getVariantsFallbacks(): array { |
41 | return [ |
42 | 'wuu' => [ 'wuu-hans', 'wuu-hant' ], |
43 | 'wuu-hans' => [ 'wuu' ], |
44 | 'wuu-hant' => [ 'wuu' ], |
45 | ]; |
46 | } |
47 | |
48 | protected function getAdditionalManualLevel(): array { |
49 | return [ 'wuu' => 'disable' ]; |
50 | } |
51 | |
52 | public function getDescCodeSeparator(): string { |
53 | return ':'; |
54 | } |
55 | |
56 | public function getDescVarSeparator(): string { |
57 | return ';'; |
58 | } |
59 | |
60 | public function getVariantNames(): array { |
61 | $names = [ |
62 | 'wuu' => '原文', |
63 | 'wuu-hans' => '简体', |
64 | 'wuu-hant' => '正體', |
65 | ]; |
66 | return array_merge( parent::getVariantNames(), $names ); |
67 | } |
68 | |
69 | protected function loadDefaultTables(): array { |
70 | return [ |
71 | 'wuu-hans' => new ReplacementArray( ZhConversion::ZH_TO_HANS ), |
72 | 'wuu-hant' => new ReplacementArray( ZhConversion::ZH_TO_HANT ), |
73 | 'wuu' => new ReplacementArray, |
74 | ]; |
75 | } |
76 | |
77 | } |