Skip to content

Commit fc33413

Browse files
authored
Merge pull request #5173 from wikimedia/T384073-dupes
Remove duplicate languages
2 parents 50d644c + 5b22cbc commit fc33413

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+879
-710
lines changed

Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift

+19
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ class WikipediaLanguageCommandLineUtilityAPI {
5252
return Wikipedia(languageCode: code, languageName: name, localName: localname, altISOCode: "nb")
5353
}
5454

55+
// If there's a site array populated with a subdomain that does NOT equal languageCode, skip. It might show up as a dupe in the languages list.
56+
// TODO: This is a temporary workaround to remove duplicated languages, but eventually a proper data migration for the user might need to occur to switch from the old language code to the new.
57+
if let sites = result["site"] as? [[String : Any]] {
58+
let site = sites.first
59+
60+
if let siteURLString = site?["url"] as? String,
61+
let components = URLComponents(string: siteURLString),
62+
let host = components.host,
63+
let hostLangCode = host.components(separatedBy: ".").first {
64+
65+
if siteURLString.hasSuffix("wikipedia.org") {
66+
if code != hostLangCode && code != "yue" { // Cantonese has already slipped in here twice, so leaving it in as a dupe until we can clean up user databases.
67+
return nil
68+
}
69+
}
70+
71+
}
72+
}
73+
5574
return Wikipedia(languageCode: code, languageName: name, localName: localname, altISOCode: nil)
5675
}
5776
// Add testwiki and test2wiki, they are not returned by the site matrix

Wikipedia/Code/wikipedia-languages.json

+5-30
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,6 @@
569569
"languageName" : "Ghanaian Pidgin",
570570
"localName" : "Ghanaian Pidgin"
571571
},
572-
{
573-
"languageCode" : "gsw",
574-
"languageName" : "Alemannisch",
575-
"localName" : "Alemannic"
576-
},
577572
{
578573
"languageCode" : "gu",
579574
"languageName" : "ગુજરાતી",
@@ -969,11 +964,6 @@
969964
"languageName" : "latviešu",
970965
"localName" : "Latvian"
971966
},
972-
{
973-
"languageCode" : "lzh",
974-
"languageName" : "文言",
975-
"localName" : "Literary Chinese"
976-
},
977967
{
978968
"languageCode" : "mad",
979969
"languageName" : "Madhurâ",
@@ -1109,11 +1099,6 @@
11091099
"languageName" : "Nāhuatl",
11101100
"localName" : "Nahuatl"
11111101
},
1112-
{
1113-
"languageCode" : "nan",
1114-
"languageName" : "閩南語 \/ Bân-lâm-gú",
1115-
"localName" : "Minnan"
1116-
},
11171102
{
11181103
"languageCode" : "nap",
11191104
"languageName" : "Napulitano",
@@ -1360,11 +1345,6 @@
13601345
"languageName" : "русиньскый",
13611346
"localName" : "Rusyn"
13621347
},
1363-
{
1364-
"languageCode" : "rup",
1365-
"languageName" : "armãneashti",
1366-
"localName" : "Aromanian"
1367-
},
13681348
{
13691349
"languageCode" : "rw",
13701350
"languageName" : "Ikinyarwanda",
@@ -1415,11 +1395,6 @@
14151395
"languageName" : "Sängö",
14161396
"localName" : "Sango"
14171397
},
1418-
{
1419-
"languageCode" : "sgs",
1420-
"languageName" : "žemaitėška",
1421-
"localName" : "Samogitian"
1422-
},
14231398
{
14241399
"languageCode" : "sh",
14251400
"languageName" : "srpskohrvatski \/ српскохрватски",
@@ -1595,6 +1570,11 @@
15951570
"languageName" : "ትግርኛ",
15961571
"localName" : "Tigrinya"
15971572
},
1573+
{
1574+
"languageCode" : "tig",
1575+
"languageName" : "ትግሬ",
1576+
"localName" : "Tigre"
1577+
},
15981578
{
15991579
"languageCode" : "tk",
16001580
"languageName" : "Türkmençe",
@@ -1720,11 +1700,6 @@
17201700
"languageName" : "Volapük",
17211701
"localName" : "Volapük"
17221702
},
1723-
{
1724-
"languageCode" : "vro",
1725-
"languageName" : "võro",
1726-
"localName" : "Võro"
1727-
},
17281703
{
17291704
"languageCode" : "wa",
17301705
"languageName" : "walon",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
[
2+
{
3+
"aliases" : [
4+
"alt=$1"
5+
],
6+
"name" : "img_alt"
7+
},
8+
{
9+
"aliases" : [
10+
"baseline"
11+
],
12+
"name" : "img_baseline"
13+
},
14+
{
15+
"aliases" : [
16+
"border"
17+
],
18+
"name" : "img_border"
19+
},
20+
{
21+
"aliases" : [
22+
"bottom"
23+
],
24+
"name" : "img_bottom"
25+
},
26+
{
27+
"aliases" : [
28+
"center",
29+
"centre"
30+
],
31+
"name" : "img_center"
32+
},
33+
{
34+
"aliases" : [
35+
"frame",
36+
"framed",
37+
"enframed"
38+
],
39+
"name" : "img_framed"
40+
},
41+
{
42+
"aliases" : [
43+
"frameless"
44+
],
45+
"name" : "img_frameless"
46+
},
47+
{
48+
"aliases" : [
49+
"left"
50+
],
51+
"name" : "img_left"
52+
},
53+
{
54+
"aliases" : [
55+
"middle"
56+
],
57+
"name" : "img_middle"
58+
},
59+
{
60+
"aliases" : [
61+
"none"
62+
],
63+
"name" : "img_none"
64+
},
65+
{
66+
"aliases" : [
67+
"right"
68+
],
69+
"name" : "img_right"
70+
},
71+
{
72+
"aliases" : [
73+
"sub"
74+
],
75+
"name" : "img_sub"
76+
},
77+
{
78+
"aliases" : [
79+
"super",
80+
"sup"
81+
],
82+
"name" : "img_super"
83+
},
84+
{
85+
"aliases" : [
86+
"text-bottom"
87+
],
88+
"name" : "img_text_bottom"
89+
},
90+
{
91+
"aliases" : [
92+
"text-top"
93+
],
94+
"name" : "img_text_top"
95+
},
96+
{
97+
"aliases" : [
98+
"thumb",
99+
"thumbnail"
100+
],
101+
"name" : "img_thumbnail"
102+
},
103+
{
104+
"aliases" : [
105+
"top"
106+
],
107+
"name" : "img_top"
108+
},
109+
{
110+
"aliases" : [
111+
"upright",
112+
"upright=$1",
113+
"upright $1"
114+
],
115+
"name" : "img_upright"
116+
},
117+
{
118+
"aliases" : [
119+
"ፋይል",
120+
"Image"
121+
],
122+
"name" : "file_namespace"
123+
}
124+
]

Wikipedia/Code/wikipedia-namespaces/alt.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"ОБСУЖДЕНИЕ ИЗОБРАЖЕНИЯ" : 7,
4545
"ТУРУЖААЧЫ" : 2,
4646
"ТУРУЖААЧЫНЫ ШӰӰЖЕРИ" : 3,
47+
"ӰЛЕКЕР" : 10,
48+
"ӰЛЕКЕРДИ ШӰӰЖЕРИ" : 11,
4749
"ФАЙЛ" : 6,
4850
"ФАЙЛДЫ ШӰӰЖЕРИ" : 7,
49-
"ШӰӰЖӰ" : 1,
50-
"ӰЛЕКЕР" : 10,
51-
"ӰЛЕКЕРДИ ШӰӰЖЕРИ" : 11
51+
"ШӰӰЖӰ" : 1
5252
}
5353
}

Wikipedia/Code/wikipedia-namespaces/ami.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"MODULE" : 828,
3131
"MODULE TALK" : 829,
3232
"NIPADAMA'" : 12,
33-
"NIPADAMA' A MASASOWAL" : 13,
3433
"NIPADAMA’" : 12,
34+
"NIPADAMA' A MASASOWAL" : 13,
3535
"PROJECT" : 4,
3636
"PROJECT TALK" : 5,
3737
"SPECIAL" : -1,

Wikipedia/Code/wikipedia-namespaces/an.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"namespace" : {
44
"" : 0,
55
"ADUYA" : 12,
6+
"CATEGORÍA" : 14,
67
"CATEGORY" : 14,
78
"CATEGORY TALK" : 15,
8-
"CATEGORÍA" : 14,
99
"DESCUSIÓN" : 1,
1010
"DESCUSIÓN ADUYA" : 13,
1111
"DESCUSIÓN CATEGORÍA" : 15,

Wikipedia/Code/wikipedia-namespaces/ang.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"BILIÞMOTUNG" : 7,
77
"BILIÞMŌTUNG" : 7,
88
"BRUCEND" : 2,
9-
"BRUCENDMOTUNG" : 3,
109
"BRŪCEND" : 2,
10+
"BRUCENDMOTUNG" : 3,
1111
"BRŪCENDMŌTUNG" : 3,
1212
"BYSEN" : 10,
1313
"BYSENGESPREC" : 11,
@@ -49,33 +49,33 @@
4949
"USER" : 2,
5050
"USER TALK" : 3,
5151
"WICIPAEDIA" : 4,
52-
"WICIPAEDIAMOTUNG" : 5,
5352
"WICIPÆDIA" : 4,
54-
"WICIPÆDIAMOTUNG" : 5,
5553
"WICIPǢDIA" : 4,
54+
"WICIPAEDIAMOTUNG" : 5,
55+
"WICIPÆDIAMOTUNG" : 5,
5656
"WICIPǢDIAMŌTUNG" : 5,
5757
"WIKIPAEDIA" : 4,
58-
"WIKIPAEDIAMOTUNG" : 5,
59-
"WIKIPEDIA" : 4,
60-
"WIKIPEDIA TALK" : 5,
6158
"WIKIPÆDIA" : 4,
62-
"WIKIPÆDIAMOTUNG" : 5,
6359
"WIKIPǢDIA" : 4,
60+
"WIKIPAEDIAMOTUNG" : 5,
61+
"WIKIPÆDIAMOTUNG" : 5,
6462
"WIKIPǢDIAMŌTUNG" : 5,
63+
"WIKIPEDIA" : 4,
64+
"WIKIPEDIA TALK" : 5,
6565
"WP" : 4,
6666
"YMELE" : 6,
6767
"YMELMŌTUNG" : 7,
6868
"ǷICIPAEDIA" : 4,
69-
"ǷICIPAEDIAMOTUNG" : 5,
7069
"ǷICIPÆDIA" : 4,
71-
"ǷICIPÆDIAMOTUNG" : 5,
7270
"ǷICIPǢDIA" : 4,
71+
"ǷICIPAEDIAMOTUNG" : 5,
72+
"ǷICIPÆDIAMOTUNG" : 5,
7373
"ǷICIPǢDIAMŌTUNG" : 5,
7474
"ǷIKIPAEDIA" : 4,
75-
"ǷIKIPAEDIAMOTUNG" : 5,
7675
"ǷIKIPÆDIA" : 4,
77-
"ǷIKIPÆDIAMOTUNG" : 5,
7876
"ǷIKIPǢDIA" : 4,
77+
"ǷIKIPAEDIAMOTUNG" : 5,
78+
"ǷIKIPÆDIAMOTUNG" : 5,
7979
"ǷIKIPǢDIAMŌTUNG" : 5
8080
}
8181
}

Wikipedia/Code/wikipedia-namespaces/ann.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"MODULE" : 828,
2020
"MODULE TALK" : 829,
2121
"NTAP-UBỌK" : 12,
22+
"ỌGBỌN̄" : 14,
23+
"ÒSIKWAAN̄" : 2,
2224
"PROJECT" : 4,
2325
"PROJECT TALK" : 5,
2426
"SPECIAL" : -1,
@@ -32,17 +34,15 @@
3234
"UKPATU FAILU" : 7,
3335
"UKPATU MEDIAWIKI" : 9,
3436
"UKPATU NTAP-UBỌK" : 13,
37+
"UKPATU ỌGBỌN̄" : 15,
38+
"UKPATU ÒSIKWAAN̄" : 3,
3539
"UKPATU TEMPULET" : 11,
3640
"UKPATU WÌKÌPEDIA" : 5,
37-
"UKPATU ÒSIKWAAN̄" : 3,
38-
"UKPATU ỌGBỌN̄" : 15,
3941
"USER" : 2,
4042
"USER TALK" : 3,
4143
"WIKIPEDIA" : 4,
42-
"WIKIPEDIA TALK" : 5,
43-
"WP" : 4,
4444
"WÌKÌPEDIA" : 4,
45-
"ÒSIKWAAN̄" : 2,
46-
"ỌGBỌN̄" : 14
45+
"WIKIPEDIA TALK" : 5,
46+
"WP" : 4
4747
}
4848
}

Wikipedia/Code/wikipedia-namespaces/as.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
"মিডিয়াৱিকি আলোচনা" : 9,
5858
"মেডিয়াৱিকি" : 8,
5959
"মেডিয়াৱিকি বাৰ্তা" : 9,
60+
"ৱিকিচ'ৰা" : 100,
61+
"ৱিকিচ'ৰা আলোচনা" : 101,
62+
"ৱিকিপিডিয়া" : 4,
63+
"ৱিকিপিডিয়া वार्ता" : 5,
64+
"ৱিকিপিডিয়া বার্তা" : 5,
65+
"ৱিকিপিডিয়া বাৰ্তা" : 5,
6066
"শ্রেণী" : 14,
6167
"শ্রেণী বার্তা" : 15,
6268
"শ্ৰেণী" : 14,
@@ -69,12 +75,6 @@
6975
"সহায় বাৰ্তা" : 13,
7076
"সাঁচ" : 10,
7177
"সাঁচ বার্তা" : 11,
72-
"সাঁচ বাৰ্তা" : 11,
73-
"ৱিকিচ'ৰা" : 100,
74-
"ৱিকিচ'ৰা আলোচনা" : 101,
75-
"ৱিকিপিডিয়া" : 4,
76-
"ৱিকিপিডিয়া वार्ता" : 5,
77-
"ৱিকিপিডিয়া বার্তা" : 5,
78-
"ৱিকিপিডিয়া বাৰ্তা" : 5
78+
"সাঁচ বাৰ্তা" : 11
7979
}
8080
}

0 commit comments

Comments
 (0)