Step 1 of renaming sr-ec and sr-el to sr-cyrl and sr-latn

The language codes sr-ec and sr-el are not conform to BCP 47.
BCP 47 explicit mentions sr-Latn and sr-Cyrl as examples.

This change adds support for the language codes sr-cyrl and sr-latn
as fallback languages of the language codes sr-ec and sr-el. This
allows to rename the message files and the system messages without
changing the language codes yet.

The next step is to rename the language codes in Translatewiki as
described in https://translatewiki.net/wiki/Renaming_language_codes
Also local system messages in MediaWiki:*/sr-ec and MediaWiki:*/sr-el
can moved to MediaWiki:*/sr-cyrl and MediaWiki:*/sr-latn.

The final step is the change I75da0af35a2066e7963e50c56c99daf1e07c55e6
to complete the rename of the language codes.

Bug: T117845
Change-Id: I666fbdea89ccf21aab6ca1849adf22813dec052e
This commit is contained in:
Fomafix 2018-10-16 20:34:08 +02:00
parent aa1e699779
commit 6839b85994
12 changed files with 21 additions and 10 deletions

View file

@ -144,6 +144,9 @@ because of Phabricator reports.
you mean to use it as "Media:", these need to be replaced to "Media:".
* (T309866) Some namespace translations were updated for Kyrgyz (ky). The old
ones are retained as aliases for backwards compatibility.
* (T117845) Started the renaming of the language codes for Serbian from sr-ec
and sr-el to sr-cyrl and sr-latn.
* …
=== Breaking changes in 1.39 ===
* Basic non-JavaScript (Grade C) support has been dropped for Internet Explorer

View file

@ -3418,8 +3418,10 @@
"variantname-gan-hans": "Hans",
"variantname-gan-hant": "Hant",
"variantname-gan": "gan",
"variantname-sr-cyrl": "sr-Cyrl",
"variantname-sr-ec": "sr-Cyrl",
"variantname-sr-el": "sr-Latn",
"variantname-sr-latn": "sr-Latn",
"variantname-sr": "sr",
"variantname-kk-kz": "kk-KZ",
"variantname-kk-tr": "kk-TR",

View file

@ -3657,8 +3657,10 @@
"variantname-gan-hans": "{{Optional}}\n\nVariant option for wikis with variants conversion enabled.",
"variantname-gan-hant": "{{Optional}}\n\nVariant option for wikis with variants conversion enabled.",
"variantname-gan": "{{Optional}}\n\nVariant option for wikis with variants conversion enabled.",
"variantname-sr-cyrl": "{{optional}}\nVariant Option for wikis with variants conversion enabled.",
"variantname-sr-ec": "{{optional}}\nVariant Option for wikis with variants conversion enabled.\n\nNote that <code>sr-ec</code> is not a conforming BCP 47 language tag. Wikis should be migrated by:\n* allowing it only as a legacy alias of the preferred tag <code>sr-cyrl</code> (possibly insert a tracking category in templates as long as they must support the legacy tag),\n* making the new tag the default to look first, before looking for the old tag,\n* moving the translations to the new code by renaming them,\n* checking links in source pages still using the legacy tag to change it to the new tag,\n* possibly cleanup the redirect pages.",
"variantname-sr-el": "{{optional}}\nVariant Option for wikis with variants conversion enabled.\n\nNote that <code>sr-el</code> is not a conforming BCP 47 language tag. Wikis should be migrated by:\n* allowing it only as a legacy alias of the preferred tag <code>sr-latn</code> (possibly insert a tracking category in templates as long as they must support the legacy tag),\n* making the new tag the default to look first, before looking for the old tag,\n* moving the translations to the new code by renaming them,\n* checking links in source pages still using the legacy tag to change it to the new tag,\n* possibly cleanup the redirect pages.",
"variantname-sr-latn": "{{optional}}\nVariant Option for wikis with variants conversion enabled.",
"variantname-sr": "{{optional}}\nVariant Option for wikis with variants conversion enabled.",
"variantname-kk-kz": "{{optional}}\nVariant Option for wikis with variants conversion enabled.",
"variantname-kk-tr": "{{optional}}\nVariant Option for wikis with variants conversion enabled.",

View file

@ -9,7 +9,7 @@
* @author Keresturec
*/
$fallback = 'sr-ec';
$fallback = 'sr-ec, sr-cyrl';
$namespaceNames = [
NS_MEDIA => 'Медий',

View file

@ -13,7 +13,7 @@
* @author לערי ריינהארט
*/
$fallback = 'bs, sr-el, hr';
$fallback = 'bs, sr-el, sr-latn, hr';
$namespaceNames = [
NS_SPECIAL => 'Posebno',

View file

@ -13,6 +13,6 @@
* @author Михајло Анђелковић
*/
$fallback = 'sr-ec';
$fallback = 'sr-ec, sr-cyrl';
$linkTrail = '/^([abvgdđežzijklljmnnjoprstćufhcčdžšабвгдђежзијклљмнњопрстћуфхцчџш]+)(.*)$/usD';

View file

@ -32,6 +32,8 @@
* @author לערי ריינהארט
*/
$fallback = 'sr-cyrl';
$namespaceNames = [
NS_MEDIA => 'Медиј',
NS_SPECIAL => 'Посебно',

View file

@ -23,6 +23,8 @@
* @author לערי ריינהארט
*/
$fallback = 'sr-latn';
$namespaceNames = [
NS_MEDIA => 'Medij',
NS_SPECIAL => 'Posebno',

View file

@ -144,7 +144,7 @@
sg: [ 'fr' ],
sgs: [ 'lt' ],
sli: [ 'de' ],
sr: [ 'sr-ec' ],
sr: [ 'sr-ec', 'sr-cyrl' ],
srn: [ 'nl' ],
stq: [ 'de' ],
su: [ 'id' ],

View file

@ -55,7 +55,7 @@ class ApiQueryLanguageinfoTest extends ApiTestCase {
'bcp47' => 'sh',
'autonym' => 'srpskohrvatski / српскохрватски',
'name' => 'Serbo-Croatian',
'fallbacks' => [ 'bs', 'sr-el', 'hr' ],
'fallbacks' => [ 'bs', 'sr-el', 'sr-latn', 'hr' ],
'dir' => 'ltr',
'variants' => [ 'sh' ],
],

View file

@ -16,7 +16,7 @@ class LanguageFallbackTest extends MediaWikiUnitTestCase {
'sco' => [ 'en' ],
'yi' => [ 'he' ],
'ruq' => [ 'ruq-latn', 'ro' ],
'sh' => [ 'bs', 'sr-el', 'hr' ],
'sh' => [ 'bs', 'sr-el', 'sr-latn', 'hr' ],
];
private function getLanguageNameUtils() {

View file

@ -120,7 +120,7 @@ trait LanguageFallbackTestTrait {
'sco' => [ 'sco', [ 'en' ] ],
'yi' => [ 'yi', [ 'he', 'en' ] ],
'ruq' => [ 'ruq', [ 'ruq-latn', 'ro', 'en' ] ],
'sh' => [ 'sh', [ 'bs', 'sr-el', 'hr', 'en' ] ],
'sh' => [ 'sh', [ 'bs', 'sr-el', 'sr-latn', 'hr', 'en' ] ],
];
}
@ -145,7 +145,7 @@ trait LanguageFallbackTestTrait {
'sco' => [ 'sco', [ 'en' ] ],
'yi' => [ 'yi', [ 'he' ] ],
'ruq' => [ 'ruq', [ 'ruq-latn', 'ro' ] ],
'sh' => [ 'sh', [ 'bs', 'sr-el', 'hr' ] ],
'sh' => [ 'sh', [ 'bs', 'sr-el', 'sr-latn', 'hr' ] ],
];
}
@ -232,9 +232,9 @@ trait LanguageFallbackTestTrait {
'yi on yi' => [ 'yi', 'yi', [ [ 'he', 'en' ], [ 'yi' ] ] ],
'sh on ruq' => [ 'sh', 'ruq',
[ [ 'bs', 'sr-el', 'hr', 'en' ], [ 'ruq', 'ruq-latn', 'ro' ] ], 2 ],
[ [ 'bs', 'sr-el', 'sr-latn', 'hr', 'en' ], [ 'ruq', 'ruq-latn', 'ro' ] ], 2 ],
'ruq on sh' => [ 'ruq', 'sh',
[ [ 'ruq-latn', 'ro', 'en' ], [ 'sh', 'bs', 'sr-el', 'hr' ] ], 2 ],
[ [ 'ruq-latn', 'ro', 'en' ], [ 'sh', 'bs', 'sr-el', 'sr-latn', 'hr' ] ], 2 ],
];
}
}