X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2FSetup.php;h=aba050d6e37bfaf3ad517e3bead5301d91423de3;hb=2bb276f07d2f291413fd41e0c62872ef39caed6e;hp=bdfce622933b9d4177c7c20bcaca9c2f6d9addbe;hpb=69d27cc0b6d779af8d870fd0e8ccb5cd41f887ab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index bdfce62293..aba050d6e3 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -498,11 +498,24 @@ if ( is_array( $wgExtraNamespaces ) ) { $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces; } +// Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.php +if ( count( $wgDummyLanguageCodes ) !== 0 ) { + wfDeprecated( '$wgDummyLanguageCodes', '1.29' ); +} // Merge in the legacy language codes, incorporating overrides from the config $wgDummyLanguageCodes += [ + // Internal language codes of the private-use area which get mapped to + // themselves. 'qqq' => 'qqq', // Used for message documentation 'qqx' => 'qqx', // Used for viewing message keys ] + $wgExtraLanguageCodes + LanguageCode::getDeprecatedCodeMapping(); +// Merge in (inverted) BCP 47 mappings +foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) { + $bcp47 = strtolower( $bcp47 ); // force case-insensitivity + if ( !isset( $wgDummyLanguageCodes[$bcp47] ) ) { + $wgDummyLanguageCodes[$bcp47] = $wgDummyLanguageCodes[$code] ?? $code; + } +} // These are now the same, always // To determine the user language, use $wgLang->getCode()