-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrateConverterRulesZh_mo.php
More file actions
41 lines (34 loc) · 1.07 KB
/
migrateConverterRulesZh_mo.php
File metadata and controls
41 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once( dirname( __FILE__ ) . '/MigrateConverterRules.php' );
class MigrateConverterRulesZh_mo extends MigrateConverterRules {
public function getEditSummary() {
return wfMessage( 'ts-migrate-converter-rules-zh-mo' )->text();
}
public function isCacheable() {
return true;
}
public function migrateRule( $rule, $title ) {
# Unidtable
$unidMO = isset( $rule->mUnidtable['zh-mo'] ) ? $rule->mUnidtable['zh-mo'] : array();
$unidHK = isset( $rule->mUnidtable['zh-hk'] ) ? $rule->mUnidtable['zh-hk'] : array();
$unidMOx = $unidMO + $unidHK;
if ( count( $unidMO ) < count( $unidMOx ) ) {
$rule->mRules = null;
$rule->mUnidtable['zh-mo'] = $unidMOx;
}
# Bidtable
$bid = &$rule->mBidtable;
if ( isset( $bid['zh-mo'] ) || !isset( $bid['zh-hk'] ) || !isset( $bid['zh-hant'] ) ) {
return;
}
if ( isset( $bid['zh-tw'] ) ) {
$bid['zh-mo'] = $bid['zh-hk'];
} else {
$bid['zh-tw'] = $bid['zh-hant'];
unset( $bid['zh-hant'] );
}
$rule->mRules = null;
}
}
$maintClass = "MigrateConverterRulesZh_mo";
require_once( RUN_MAINTENANCE_IF_MAIN );