forked from ProfessionalWiki/Maps
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SUS-2587: Implement MW 1.19 compatibility (#4)
- Loading branch information
Máté Szabó
authored
Jan 24, 2018
1 parent
4c1d0a8
commit e4f1b2b
Showing
11 changed files
with
92 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,10 @@ | |
|
||
!.* | ||
.idea/ | ||
*.iml | ||
|
||
vendor/ | ||
extensions/ | ||
|
||
composer.phar | ||
composer.lock | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* Beginning with MediaWiki 1.23, translation strings are stored in json files, | ||
* and the EXTENSION.i18n.php file only exists to provide compatibility with | ||
* older releases of MediaWiki. For more information about this migration, see: | ||
* https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format | ||
* | ||
* This shim maintains compatibility back to MediaWiki 1.17. | ||
*/ | ||
|
||
$messages = []; | ||
|
||
if ( !function_exists( 'wfJsonI18nShimWikiaMaps' ) ) { | ||
function wfJsonI18nShimWikiaMaps( $cache, $code, &$cachedData ) { | ||
$codeSequence = array_merge( [ $code ], $cachedData['fallbackSequence'] ); | ||
foreach ( $codeSequence as $csCode ) { | ||
$fileName = __DIR__ . "/i18n/$csCode.json"; | ||
if ( is_readable( $fileName ) ) { | ||
$data = FormatJson::decode( file_get_contents( $fileName ), true ); | ||
foreach ( array_keys( $data ) as $key ) { | ||
if ( $key === '' || $key[0] === '@' ) { | ||
unset( $data[$key] ); | ||
} | ||
} | ||
$cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); | ||
} | ||
|
||
$cachedData['deps'][] = new FileDependency( $fileName ); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimWikiaMaps'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
includes/services/Leaflet/leaflet-providers/leaflet-providers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters