11 use MediaWikiCoversValidator;
20 $map = LanguageCode::getDeprecatedCodeMapping();
41 $this->
assertEquals(
'gsw', LanguageCode::replaceDeprecatedCodes(
'als' ) );
42 $this->
assertEquals(
'gsw', LanguageCode::replaceDeprecatedCodes(
'gsw' ) );
43 $this->
assertEquals(
null, LanguageCode::replaceDeprecatedCodes(
null ) );
58 "Applying BCP 47 standard to '$code'"
63 "Applying BCP 47 standard to lower case '$code'"
68 "Applying BCP 47 standard to upper case '$code'"
79 [
'en-ca-x-ca',
'en-CA-x-ca' ],
80 [
'sgn-be-fr',
'sgn-BE-FR' ],
81 [
'az-latn-x-latn',
'az-Latn-x-latn' ],
83 [
'sr-Latn-RS',
'sr-Latn-RS' ],
84 [
'az-arab-ir',
'az-Arab-IR' ],
87 [
'sl-nedis',
'sl-nedis' ],
88 [
'de-ch-1996',
'de-CH-1996' ],
92 'en-latn-gb-boont-r-extended-sequence-x-private',
93 'en-Latn-GB-boont-r-extended-sequence-x-private'
97 # Simple language subtag:
102 # Language subtag plus script subtag:
103 [
'zh-hans',
'zh-Hans' ],
104 [
'sr-cyrl',
'sr-Cyrl' ],
105 [
'sr-latn',
'sr-Latn' ],
107 # Extended language subtags and their primary language subtag
109 [
'zh-cmn-hans-cn',
'zh-cmn-Hans-CN' ],
110 [
'cmn-hans-cn',
'cmn-Hans-CN' ],
111 [
'zh-yue-hk',
'zh-yue-HK' ],
112 [
'yue-hk',
'yue-HK' ],
114 # Language-Script-Region:
115 [
'zh-hans-cn',
'zh-Hans-CN' ],
116 [
'sr-latn-RS',
'sr-Latn-RS' ],
119 [
'sl-rozaj',
'sl-rozaj' ],
120 [
'sl-rozaj-biske',
'sl-rozaj-biske' ],
121 [
'sl-nedis',
'sl-nedis' ],
123 # Language-Region-Variant:
124 [
'de-ch-1901',
'de-CH-1901' ],
125 [
'sl-it-nedis',
'sl-IT-nedis' ],
127 # Language-Script-Region-Variant:
128 [
'hy-latn-it-arevela',
'hy-Latn-IT-arevela' ],
131 [
'de-de',
'de-DE' ],
132 [
'en-us',
'en-US' ],
133 [
'es-419',
'es-419' ],
135 # Private use subtags:
136 [
'de-ch-x-phonebk',
'de-CH-x-phonebk' ],
137 [
'az-arab-x-aze-derbend',
'az-Arab-x-aze-derbend' ],
146 # Private use registry values:
147 [
'x-whatever',
'x-whatever' ],
148 [
'qaa-qaaa-qm-x-southern',
'qaa-Qaaa-QM-x-southern' ],
149 [
'de-qaaa',
'de-Qaaa' ],
150 [
'sr-latn-qm',
'sr-Latn-QM' ],
151 [
'sr-qaaa-rs',
'sr-Qaaa-RS' ],
153 # Tags that use extensions
154 [
'en-us-u-islamcal',
'en-US-u-islamcal' ],
155 [
'zh-cn-a-myext-x-private',
'zh-CN-a-myext-x-private' ],
156 [
'en-a-myext-b-another',
'en-a-myext-b-another' ],
163 # Non-standard and deprecated language codes used by MediaWiki
165 [
'bat-smg',
'sgs' ],
166 [
'be-x-old',
'be-tarask' ],
167 [
'fiu-vro',
'vro' ],
168 [
'roa-rup',
'rup' ],
169 [
'zh-classical',
'lzh' ],
170 [
'zh-min-nan',
'nan' ],
172 [
'cbk-zam',
'cbk' ],
173 [
'de-formal',
'de-x-formal' ],
175 [
'en-rtl',
'en-x-rtl' ],
176 [
'es-formal',
'es-x-formal' ],
177 [
'hu-formal',
'hu-x-formal' ],
178 [
'kk-Arab',
'kk-Arab' ],
179 [
'kk-Cyrl',
'kk-Cyrl' ],
180 [
'kk-Latn',
'kk-Latn' ],
181 [
'map-bms',
'jv-x-bms' ],
182 [
'mo',
'ro-Cyrl-MD' ],
184 [
'nl-informal',
'nl-x-informal' ],
185 [
'roa-tara',
'nap-x-tara' ],
186 [
'simple',
'en-simple' ],
187 [
'sr-ec',
'sr-Cyrl' ],
188 [
'sr-el',
'sr-Latn' ],
189 [
'zh-cn',
'zh-Hans-CN' ],
190 [
'zh-sg',
'zh-Hans-SG' ],
191 [
'zh-my',
'zh-Hans-MY' ],
192 [
'zh-tw',
'zh-Hant-TW' ],
193 [
'zh-hk',
'zh-Hant-HK' ],
194 [
'zh-mo',
'zh-Hant-MO' ],
195 [
'zh-hans',
'zh-Hans' ],
196 [
'zh-hant',
'zh-Hant' ],
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testGetDeprecatedCodeMapping()
testReplaceDeprecatedCodes()
testBcp47( $code, $expected)
test
static provideLanguageCodes()
Array format is ($code, $expected)
Methods for dealing with language codes.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code