Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/256949
Change subject: Remove i18n shim ...................................................................... Remove i18n shim Plus some additional small cleanups for latest best practises Change-Id: I3ccfb25eff4182b09ccf174aff3f7599ffbda3f2 --- D cldr.i18n.php M cldr.php 2 files changed, 10 insertions(+), 48 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/cldr refs/changes/49/256949/1 diff --git a/cldr.i18n.php b/cldr.i18n.php deleted file mode 100644 index 5d35d7e..0000000 --- a/cldr.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.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 = array(); -if ( !function_exists( 'wfJsonI18nShima81b5029bff0d492' ) ) { - function wfJsonI18nShima81b5029bff0d492( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/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'][] = 'wfJsonI18nShima81b5029bff0d492'; -} diff --git a/cldr.php b/cldr.php index e7a9a39..c0de17d 100644 --- a/cldr.php +++ b/cldr.php @@ -1,17 +1,15 @@ <?php -if ( !defined( 'MEDIAWIKI' ) ) die(); /** * An extension which provides localised language names for other extensions. * * @file * @ingroup Extensions * @author Niklas Laxström - * @copyright Copyright © 2007-2015, Niklas Laxström * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -define( 'CLDR_VERSION', '4.1.0 (CLDR 28)' ); +define( 'CLDR_VERSION', '4.1.1 (CLDR 28)' ); -$GLOBALS['wgExtensionCredits']['other'][] = array( +$wgExtensionCredits['other'][] = array( 'path' => __FILE__, 'name' => 'Language Names', 'version' => CLDR_VERSION, @@ -20,12 +18,11 @@ 'descriptionmsg' => 'cldr-desc', ); -$GLOBALS['wgMessagesDirs']['cldr'] = __DIR__ . '/i18n'; -$GLOBALS['wgExtensionMessagesFiles']['cldr'] = __DIR__ . '/cldr.i18n.php'; -$GLOBALS['wgAutoloadClasses']['CldrNames'] = __DIR__ . '/CldrNames.php'; -$GLOBALS['wgAutoloadClasses']['LanguageNames'] = __DIR__ . '/LanguageNames.body.php'; -$GLOBALS['wgAutoloadClasses']['CountryNames'] = __DIR__ . '/CountryNames.body.php'; -$GLOBALS['wgAutoloadClasses']['CurrencyNames'] = __DIR__ . '/CurrencyNames.body.php'; -$GLOBALS['wgAutoloadClasses']['TimeUnits'] = __DIR__ . '/TimeUnits.body.php'; -$GLOBALS['wgHooks']['LanguageGetTranslatedLanguageNames'][] = 'LanguageNames::coreHook'; -$GLOBALS['wgHooks']['GetHumanTimestamp'][] = 'TimeUnits::onGetHumanTimestamp'; +$wgMessagesDirs['cldr'] = __DIR__ . '/i18n'; +$wgAutoloadClasses['CldrNames'] = __DIR__ . '/CldrNames.php'; +$wgAutoloadClasses['LanguageNames'] = __DIR__ . '/LanguageNames.body.php'; +$wgAutoloadClasses['CountryNames'] = __DIR__ . '/CountryNames.body.php'; +$wgAutoloadClasses['CurrencyNames'] = __DIR__ . '/CurrencyNames.body.php'; +$wgAutoloadClasses['TimeUnits'] = __DIR__ . '/TimeUnits.body.php'; +$wgHooks['LanguageGetTranslatedLanguageNames'][] = 'LanguageNames::coreHook'; +$wgHooks['GetHumanTimestamp'][] = 'TimeUnits::onGetHumanTimestamp'; -- To view, visit https://gerrit.wikimedia.org/r/256949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ccfb25eff4182b09ccf174aff3f7599ffbda3f2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/cldr Gerrit-Branch: master Gerrit-Owner: Nikerabbit <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
