Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/176472
Change subject: Update Metrolook ...................................................................... Update Metrolook * Add translation support to description and the label guest. Change-Id: I4769ea63234872e371ad5cac562fb65fba4743e1 --- A Metrolook.i18n.php M Metrolook.php M MetrolookTemplate.php M README.md M composer.json A i18n/en.json A i18n/qqq.json 7 files changed, 67 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook refs/changes/72/176472/1 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 b169afa..2fcacfc 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' => '3.0 beta 11', + 'descriptionmsg' => 'metrolook-desc', + 'version' => '3.0 beta 12', '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 e28cede..7b39166 100644 --- a/MetrolookTemplate.php +++ b/MetrolookTemplate.php @@ -40,7 +40,7 @@ global $logo; global $SearchBar; global $DownArrow; - global $Line; + global $Line; global $image1; global $link1; global $picture1; @@ -377,7 +377,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/README.md b/README.md index fd46098..9c12b46 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,6 @@ $SearchBar = true; -Default is - -$DownArrow = true; To turn it off @@ -70,12 +67,16 @@ Default is -$Line = true; +$DownArrow = true; To turn it off $Line = false; +Default is + +$Line = true; + to change link $link1 = false; 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/176472 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4769ea63234872e371ad5cac562fb65fba4743e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: master Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits