Rewrite ULS aliases in the territories

This commit is contained in:
Niklas Laxström
2016-05-26 15:32:16 +02:00
parent 0faa9bbd4d
commit 35ce36a611
3 changed files with 15 additions and 8 deletions

View File

@@ -3879,7 +3879,7 @@
"it",
"de",
"pdt",
"cr-cans",
"cr",
"yi"
],
"CC": [
@@ -4098,7 +4098,7 @@
"FJ": [
"en",
"hi",
"hif-latn",
"hif",
"fj",
"rtm"
],
@@ -4277,7 +4277,7 @@
"ro",
"yi",
"pl",
"lad",
"lad-latn",
"hu",
"am",
"ti",
@@ -4307,7 +4307,7 @@
"ne",
"sat",
"ks-arab",
"gom",
"gom-deva",
"tcy",
"brx",
"mni",
@@ -4711,7 +4711,7 @@
],
"PH": [
"en",
"fil",
"tl",
"es",
"ceb",
"ilo",
@@ -4987,7 +4987,7 @@
"ku-latn"
],
"TN": [
"aeb",
"aeb-arab",
"ar",
"fr"
],
@@ -5058,7 +5058,7 @@
"zh-hant",
"fr",
"de",
"fil",
"tl",
"it",
"vi",
"ko",

View File

@@ -76,6 +76,13 @@ foreach ( $parsedLangdb['territories'] as $territoryCode => $languages ) {
unset( $parsedLangdb['territories'][$territoryCode][$index] );
continue;
}
$data = $parsedLangdb['languages'][$language];
if ( count( $data ) === 1 ) {
echo "Redirect for language $language to {$data[0]} territory $territoryCode\n";
$parsedLangdb['territories'][$territoryCode][$index] = $data[0];
continue;
}
}
// Clean-up to save space

File diff suppressed because one or more lines are too long