Robert Vogel has submitted this change and it was merged. Change subject: Implemented changes for translatewiki ......................................................................
Implemented changes for translatewiki Moved to Json i18n files Change-Id: I256df533e2c07b0c85a8a8e84ac2a0ae84bd1e48 --- M CSyntaxHighlight/CSyntaxHighlight.class.php M CSyntaxHighlight/CSyntaxHighlight.setup.php A CSyntaxHighlight/i18n/de.json A CSyntaxHighlight/i18n/en.json A CSyntaxHighlight/i18n/qqq.json M CSyntaxHighlight/languages/CSyntaxHighlight.i18n.php 6 files changed, 72 insertions(+), 37 deletions(-) Approvals: Robert Vogel: Verified; Looks good to me, approved Siebrand: Looks good to me, but someone else must approve diff --git a/CSyntaxHighlight/CSyntaxHighlight.class.php b/CSyntaxHighlight/CSyntaxHighlight.class.php index 5ed5e80..f71f276 100644 --- a/CSyntaxHighlight/CSyntaxHighlight.class.php +++ b/CSyntaxHighlight/CSyntaxHighlight.class.php @@ -119,13 +119,10 @@ $this->setHook( 'SkinAfterBottomScripts' ); // TODO RBV (12.04.11 15:47): Provide all config possibilities of SyntaxHighlighter... - //User variables - BsConfig::registerVar( 'MW::CSyntaxHighlight::Theme', 'Default', BsConfig::LEVEL_USER|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-csyntaxhighlight-pref-Theme', 'select' ); - BsConfig::registerVar( 'MW::CSyntaxHighlight::Gutter', true, BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-Gutter', 'toggle' ); - BsConfig::registerVar( 'MW::CSyntaxHighlight::AutoLinks', true, BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-AutoLinks', 'toggle' ); - - //Admin variables - BsConfig::registerVar( 'MW::CSyntaxHighlight::Toolbar', false, BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-Toolbar', 'toggle' ); + BsConfig::registerVar( 'MW::CSyntaxHighlight::Theme', 'Default', BsConfig::LEVEL_USER|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-csyntaxhighlight-pref-theme', 'select' ); + BsConfig::registerVar( 'MW::CSyntaxHighlight::Gutter', true, BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-gutter', 'toggle' ); + BsConfig::registerVar( 'MW::CSyntaxHighlight::AutoLinks', true, BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-autolinks', 'toggle' ); + BsConfig::registerVar( 'MW::CSyntaxHighlight::Toolbar', false, BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 'bs-csyntaxhighlight-pref-toolbar', 'toggle' ); wfProfileOut( 'BS::'.__METHOD__ ); } diff --git a/CSyntaxHighlight/CSyntaxHighlight.setup.php b/CSyntaxHighlight/CSyntaxHighlight.setup.php index 4910e23..d66d1f8 100644 --- a/CSyntaxHighlight/CSyntaxHighlight.setup.php +++ b/CSyntaxHighlight/CSyntaxHighlight.setup.php @@ -2,4 +2,6 @@ BsExtensionManager::registerExtension('CSyntaxHighlight', BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE); +$wgMessagesDirs['CSyntaxHighlight'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['CSyntaxHighlight'] = __DIR__ . '/languages/CSyntaxHighlight.i18n.php'; \ No newline at end of file diff --git a/CSyntaxHighlight/i18n/de.json b/CSyntaxHighlight/i18n/de.json new file mode 100644 index 0000000..c010704 --- /dev/null +++ b/CSyntaxHighlight/i18n/de.json @@ -0,0 +1,13 @@ +{ + "@metadata": { + "authors": [ + "Stephan Muggli <mug...@hallowelt.biz>" + ] + }, + "bs-csyntaxhighlight-desc": "Fügt eine konfigurierbare Syntaxhighlight-Funktionalität hinzu", + "prefs-csyntaxhighlight": "Syntax Highlighter", + "bs-csyntaxhighlight-pref-theme": "Theme:", + "bs-csyntaxhighlight-pref-gutter": "Zeige Zeilennummern", + "bs-csyntaxhighlight-pref-autolinks": "URLs verlinken", + "bs-csyntaxhighlight-pref-toolbar": "Werkzeugleiste einblenden" +} diff --git a/CSyntaxHighlight/i18n/en.json b/CSyntaxHighlight/i18n/en.json new file mode 100644 index 0000000..d56a634 --- /dev/null +++ b/CSyntaxHighlight/i18n/en.json @@ -0,0 +1,13 @@ +{ + "@metadata": { + "authors": [ + "Stephan Muggli <mug...@hallowelt.biz>" + ] + }, + "bs-csyntaxhighlight-desc": "Adds customizable syntax highlighting functionality", + "prefs-csyntaxhighlight": "Syntax highlighter", + "bs-csyntaxhighlight-pref-theme": "Theme:", + "bs-csyntaxhighlight-pref-gutter": "Show line numbers", + "bs-csyntaxhighlight-pref-autolinks": "Link URLs", + "bs-csyntaxhighlight-pref-toolbar": "Show toolbar" +} diff --git a/CSyntaxHighlight/i18n/qqq.json b/CSyntaxHighlight/i18n/qqq.json new file mode 100644 index 0000000..403680c --- /dev/null +++ b/CSyntaxHighlight/i18n/qqq.json @@ -0,0 +1,13 @@ +{ + "@metadata": { + "authors": [ + "Stephan Muggli <mug...@hallowelt.biz>" + ] + }, + "bs-csyntaxhighlight-desc": "Used in [[Special:Wiki_Admin&mode=ExtensionInfo]], description of csyntaxhighlight extension", + "prefs-csyntaxhighlight": "Used in [[Special:Wiki_Admin&mode=Preferences]], headline for syntax highligther section in preferences.\n{{Identical|Syntax highlighter}}", + "bs-csyntaxhighlight-pref-theme": "Option in [[Special:Wiki_Admin&mode=Preferences]], label for theme:\n{{Identical|Theme:}}", + "bs-csyntaxhighlight-pref-gutter": "Option in [[Special:Wiki_Admin&mode=Preferences]], checkbox label for show line numbers", + "bs-csyntaxhighlight-pref-autolinks": "Option in [[Special:Wiki_Admin&mode=Preferences]], checkbox label for link URLs", + "bs-csyntaxhighlight-pref-toolbar": "Option in [[Special:Wiki_Admin&mode=Preferences]], checkbox label for show toolbar" +} diff --git a/CSyntaxHighlight/languages/CSyntaxHighlight.i18n.php b/CSyntaxHighlight/languages/CSyntaxHighlight.i18n.php index fae5e26..454cb3a 100644 --- a/CSyntaxHighlight/languages/CSyntaxHighlight.i18n.php +++ b/CSyntaxHighlight/languages/CSyntaxHighlight.i18n.php @@ -1,38 +1,35 @@ <?php /** - * Internationalisation file for CSyntaxHighlight + * This is a backwards-compatibility shim, generated by: + * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php * - * Part of BlueSpice for MediaWiki + * 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 * - * @author Stephan Muggli <mug...@hallowelt.biz> - - * @package BlueSpice_Extensions - * @subpackage CSyntaxHighlight - * @copyright Copyright (C) 2012 Hallo Welt! - Medienwerkstatt GmbH, All rights reserved. - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later - * @filesource + * This shim maintains compatibility back to MediaWiki 1.17. */ - $messages = array(); +if ( !function_exists( 'wfJsonI18nShim697cf299208c6d9d' ) ) { + function wfJsonI18nShim697cf299208c6d9d( $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'] ); + } -$messages['en'] = array( - 'bs-csyntaxhighlight-extension-description' => 'Adds customizable syntax highlighting functionality to BlueSpice. Based on SyntaxHighlighter by Alex Gorbatchev (http://alexgorbatchev.com/SyntaxHighlighter/).', - 'prefs-CSyntaxHighlight' => 'Syntax Highlighter', - 'bs-csyntaxhighlight-pref-Theme' => 'Theme', - 'bs-csyntaxhighlight-pref-Gutter' => 'Gutter', - 'bs-csyntaxhighlight-pref-AutoLinks' => 'Link URLs', - 'bs-csyntaxhighlight-pref-Toolbar' => 'Show toolbar', -); + $cachedData['deps'][] = new FileDependency( $fileName ); + } + return true; + } -$messages['de'] = array( - 'bs-csyntaxhighlight-extension-description' => 'Erweitert BlueSpice um konfigurierbare SyntaxHighlight-Funktionalität. Basiert auf SyntaxHighlighter von Alex Gorbatchev (http://alexgorbatchev.com/SyntaxHighlighter/).', - 'prefs-CSyntaxHighlight' => 'Syntax Highlighter', - 'bs-csyntaxhighlight-pref-Theme' => 'Theme', - 'bs-csyntaxhighlight-pref-Gutter' => 'Zeilennummern', - 'bs-csyntaxhighlight-pref-AutoLinks' => 'URLs verlinken', - 'bs-csyntaxhighlight-pref-Toolbar' => 'Werkzeugleiste einblenden', -); - -$messages['de-formal'] = array(); - -$messages['qqq'] = array(); + $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim697cf299208c6d9d'; +} -- To view, visit https://gerrit.wikimedia.org/r/145255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I256df533e2c07b0c85a8a8e84ac2a0ae84bd1e48 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Smuggli <mug...@hallowelt.biz> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Pigpen <reym...@hallowelt.biz> Gerrit-Reviewer: Raimond Spekking <raimond.spekk...@gmail.com> Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits