Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/146134
Change subject: Add i18n file ...................................................................... Add i18n file Change-Id: Ide2d61daa8c2af5002ee0a46acd79039bfe6e3cc --- A Vine.i18n.php M Vine.php A i18n/en.json A i18n/qqq.json 4 files changed, 55 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Vine refs/changes/34/146134/1 diff --git a/Vine.i18n.php b/Vine.i18n.php new file mode 100644 index 0000000..9bd2fc0 --- /dev/null +++ b/Vine.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( 'wfJsonI18nShimea8a03dbb7dc2095' ) ) { + function wfJsonI18nShimea8a03dbb7dc2095( $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'][] = 'wfJsonI18nShimea8a03dbb7dc2095'; +} diff --git a/Vine.php b/Vine.php index abf0c8f..5f83d76 100644 --- a/Vine.php +++ b/Vine.php @@ -17,13 +17,17 @@ // Extension credits that will show up on Special:Version $wgExtensionCredits['parserhook'][] = array( + 'path' => __FILE__, 'name' => 'Vine', - 'version' => '1.1.1', + 'version' => '1.1.2', 'author' => '[http://www.shoutwiki.com/wiki/User:Cook879 Richard Cook]', 'url' => 'https://www.mediawiki.org/wiki/Extension:Vine', - 'description' => 'Adds a <code><vine></code> tag to add Vine posts to your site' + 'descriptionmsg' => 'vine-desc' ); +$wgExtensionMessagesFiles['Vine'] = __DIR__ . '/Vine.i18n.php'; +$wgMessagesDirs['Vine'] = __DIR__ . '/i18n' + // Create vine tag $wgHooks['ParserFirstCallInit'][] = 'wfVineSetup'; diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..e86ca68 --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Richard Cook" + ] + }, + "vine-desc": "Adds a <code><vine></code> tag to add Vine posts to the site" +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 0000000..31f89e2 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,6 @@ +{ + "@metadata": { + "authors": [] + }, + "vine-desc": "{{desc}}" +} -- To view, visit https://gerrit.wikimedia.org/r/146134 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide2d61daa8c2af5002ee0a46acd79039bfe6e3cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Vine Gerrit-Branch: master Gerrit-Owner: Raimond Spekking <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
