X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fcache%2Flocalisation%2FLocalisationCache.php;h=d0381cf04d794ec737e6866971d16c225753b446;hb=1de7117197761961736ea43b237599569eee93a2;hp=75e5e19bce6f211144c61872f0c06eb165ffc446;hpb=6c5bdf5ace775f97294de596288cb9b6868dd4d1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index 75e5e19bce..d0381cf04d 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -800,7 +800,7 @@ class LocalisationCache { return [ 'core' => "$IP/languages/i18n", 'api' => "$IP/includes/api/i18n", - 'oojs-ui' => "$IP/resources/lib/oojs-ui/i18n", + 'oojs-ui' => "$IP/resources/lib/ooui/i18n", ] + $messagesDirs; } @@ -838,17 +838,23 @@ class LocalisationCache { } # Fill in the fallback if it's not there already - if ( is_null( $coreData['fallback'] ) ) { - $coreData['fallback'] = $code === 'en' ? false : 'en'; - } - if ( $coreData['fallback'] === false ) { - $coreData['fallbackSequence'] = []; + if ( ( is_null( $coreData['fallback'] ) || $coreData['fallback'] === false ) && $code === 'en' ) { + $coreData['fallback'] = false; + $coreData['originalFallbackSequence'] = $coreData['fallbackSequence'] = []; } else { - $coreData['fallbackSequence'] = array_map( 'trim', explode( ',', $coreData['fallback'] ) ); + if ( !is_null( $coreData['fallback'] ) ) { + $coreData['fallbackSequence'] = array_map( 'trim', explode( ',', $coreData['fallback'] ) ); + } else { + $coreData['fallbackSequence'] = []; + } $len = count( $coreData['fallbackSequence'] ); - # Ensure that the sequence ends at en - if ( $coreData['fallbackSequence'][$len - 1] !== 'en' ) { + # Before we add the 'en' fallback for messages, keep a copy of + # the original fallback sequence + $coreData['originalFallbackSequence'] = $coreData['fallbackSequence']; + + # Ensure that the sequence ends at 'en' for messages + if ( !$len || $coreData['fallbackSequence'][$len - 1] !== 'en' ) { $coreData['fallbackSequence'][] = 'en'; } }