Paladox has submitted this change and it was merged. Change subject: Update Metrolook ......................................................................
Update Metrolook * Add translation support to description and the label guest. Change-Id: I6bd76426ada9b54c042a648d4c13be2d265d742b --- A Metrolook.i18n.php M Metrolook.php M MetrolookTemplate.php M composer.json A i18n/en.json A i18n/qqq.json 6 files changed, 61 insertions(+), 4 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Metrolook.i18n.php b/Metrolook.i18n.php new file mode 100644 index 0000000..8d63187 --- /dev/null +++ b/Metrolook.i18n.php @@ -0,0 +1,35 @@ +<?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( 'wfJsonI18nShim0ef389595e78ca38' ) ) { + function wfJsonI18nShim0ef389595e78ca38( $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'][] = 'wfJsonI18nShim0ef389595e78ca38'; +} diff --git a/Metrolook.php b/Metrolook.php index f102585..7395910 100644 --- a/Metrolook.php +++ b/Metrolook.php @@ -24,8 +24,8 @@ $GLOBALS['wgExtensionCredits']['skin'][] = array( 'path' => __FILE__, 'name' => 'Metrolook', - 'description' => 'Metrolook skin for MediaWiki.', - 'version' => '2.4.10', + 'descriptionmsg' => 'metrolook-desc', + 'version' => '2.4.11', 'url' => 'https://www.mediawiki.org/wiki/Skin:Metrolook', 'author' => array( 'immewnity', 'paladox2015', 'Craig Davison', 'lagleki' ), 'license-name' => 'GPLv2+', @@ -35,6 +35,9 @@ $GLOBALS['wgAutoloadClasses']['SkinMetrolook'] = __DIR__ . '/SkinMetrolook.php'; $GLOBALS['wgAutoloadClasses']['MetrolookTemplate'] = __DIR__ . '/MetrolookTemplate.php'; +$GLOBALS['wgExtensionMessagesFiles']['MetrolookTemplate'] = __DIR__.'/Metrolook.i18n.php'; +$GLOBALS['wgMessagesDirs']['MetrolookTemplate'] = __DIR__ . '/i18n'; + // Register skin SkinFactory::getDefaultInstance()->register( 'metrolook', 'Metrolook', function(){ $config = ConfigFactory::getDefaultInstance()->makeConfig( 'metrolook' ); diff --git a/MetrolookTemplate.php b/MetrolookTemplate.php index 3b0a365..02acf76 100644 --- a/MetrolookTemplate.php +++ b/MetrolookTemplate.php @@ -376,7 +376,7 @@ <div class="vectorMenu" style="float:right;background-image:none;vertical-align:middle;height:40px;padding-left:10px;padding-right:10px;position:relative;top:0px;right:10px;width:auto;text-align:right;"> <a href="#" style="text-decoration:none;"><span id="username-top"><?php if ($_SERVER["REMOTE_ADDR"] == htmlspecialchars($this->getSkin()->getUser()->getName())) { -echo "Guest"; +echo wfMessage( 'metrolook-guest' )->text(); } else { echo htmlspecialchars( $this->getSkin()->getUser()->getName() ); diff --git a/composer.json b/composer.json index abfde15..94d9b3e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "license" : "GPL-2.0+", "authors" : [ { - "name" : "immewnity" + "name" : "immewnity" }, { "name" : "paladox2015" diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..9c48239 --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,10 @@ +{ + "@metadata": { + "authors": [ + "paladox" + ] + }, + "skinname-metrolook": "Metrolook", + "metrolook-desc": "Metrolook skin for MediaWiki", + "metrolook-guest": "Guest" +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 0000000..17cef92 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,9 @@ +{ + "@metadata": { + "authors": [ + "paladox" + ] + }, + "metrolook-desc": "{{desc|name=Metrolook|url=http://www.mediawiki.org/wiki/Skin:Metrolook}}", + "metrolook-guest": "Used for descbribing you as a guest editing the wiki." +} -- To view, visit https://gerrit.wikimedia.org/r/176471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6bd76426ada9b54c042a648d4c13be2d265d742b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: REL1_24 Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits