- 'fallback', 'namespaceNames', 'mathNames', 'bookstoreList',
+ 'fallback', 'namespaceNames', 'bookstoreList',
'magicWords', 'messages', 'rtl', 'capitalizeAllNouns', 'digitTransformTable',
'separatorTransformTable', 'fallback8bitEncoding', 'linkPrefixExtension',
'defaultUserOptionOverrides', 'linkTrail', 'namespaceAliases',
'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
'defaultDateFormat', 'extraUserToggles', 'specialPageAliases',
'magicWords', 'messages', 'rtl', 'capitalizeAllNouns', 'digitTransformTable',
'separatorTransformTable', 'fallback8bitEncoding', 'linkPrefixExtension',
'defaultUserOptionOverrides', 'linkTrail', 'namespaceAliases',
'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
'defaultDateFormat', 'extraUserToggles', 'specialPageAliases',
);
/**
* Keys for items which consist of associative arrays, which may be merged
* by a fallback sequence.
*/
);
/**
* Keys for items which consist of associative arrays, which may be merged
* by a fallback sequence.
*/
- static public $mergeableMapKeys = array( 'messages', 'namespaceNames', 'mathNames',
- 'dateFormats', 'defaultUserOptionOverrides', 'magicWords', 'imageFiles',
+ static public $mergeableMapKeys = array( 'messages', 'namespaceNames',
+ 'dateFormats', 'defaultUserOptionOverrides', 'imageFiles',
self::$mergeableMapKeys,
self::$mergeableListKeys,
self::$mergeableAliasListKeys,
self::$mergeableMapKeys,
self::$mergeableListKeys,
self::$mergeableAliasListKeys,
# Recache the data if necessary
if ( !$this->manualRecache && $this->isExpired( $code ) ) {
if ( file_exists( Language::getMessagesFileName( $code ) ) ) {
# Recache the data if necessary
if ( !$this->manualRecache && $this->isExpired( $code ) ) {
if ( file_exists( Language::getMessagesFileName( $code ) ) ) {
+ protected function mergeMagicWords( &$value, $fallbackValue ) {
+ foreach ( $fallbackValue as $magicName => $fallbackInfo ) {
+ if ( !isset( $value[$magicName] ) ) {
+ $value[$magicName] = $fallbackInfo;
+ } else {
+ $oldSynonyms = array_slice( $fallbackInfo, 1 );
+ $newSynonyms = array_slice( $value[$magicName], 1 );
+ $synonyms = array_values( array_unique( array_merge(
+ $newSynonyms, $oldSynonyms ) ) );
+ $value[$magicName] = array_merge( array( $fallbackInfo[0] ), $synonyms );
+ }
+ }
+ }
+
/**
* Given an array mapping language code to localisation value, such as is
* found in extension *.i18n.php files, iterate through a fallback sequence
/**
* Given an array mapping language code to localisation value, such as is
* found in extension *.i18n.php files, iterate through a fallback sequence