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
Removed duplicate message

Change-Id: I5fe67695e2791b7fde8353d7de48256d93e07033
---
M Checklist/Checklist.class.php
M Checklist/Checklist.setup.php
A Checklist/i18n/de.json
A Checklist/i18n/en.json
A Checklist/i18n/qqq.json
M Checklist/languages/Checklist.i18n.php
M Checklist/resources/bluespice.checklist.js
7 files changed, 117 insertions(+), 86 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved
  Siebrand: Looks good to me, but someone else must approve



diff --git a/Checklist/Checklist.class.php b/Checklist/Checklist.class.php
index 86029bc..da50946 100644
--- a/Checklist/Checklist.class.php
+++ b/Checklist/Checklist.class.php
@@ -44,7 +44,7 @@
 
        public $iCheckboxCounter = 0;
        public $bCheckboxFound = false;
-       
+
        public function __construct() {
                wfProfileIn( 'BS::'.__METHOD__ );
 
@@ -88,7 +88,7 @@
 
                $iIndexStandard = array_search( 
'unlink',$aConfigStandard["toolbar1"] );
                array_splice( $aConfigStandard["toolbar1"], $iIndexStandard + 
1, 0, "bscheckbox" );
-               
+
                // Add context menu entry
                $aConfigStandard["contextmenu"] = 
str_replace('bsContextMenuMarker', 'bsContextMenuMarker bsChecklist', 
$aConfigStandard["contextmenu"] );
                return true;
@@ -106,7 +106,7 @@
                $oWikiPage = WikiPage::newFromID( $sArticleId );
                $oContent = $oWikiPage->getContent();
                $sContent = $oContent->getNativeData();
-               
+
                // Maybe a sanity-check is just enough here
                $sNewValue = 'value="';
                if ($sValue == 'true' )
@@ -117,11 +117,11 @@
                        $sNewValue .= $sValue;
                #$sNewValue .= $iPos;
                $sNewValue .= '" ';
-               
+
                $sContent = self::preg_replace_nth( "/(<bs:checklist 
)([^>]*?>)/", "$1".$sNewValue."$2", $sContent, $iPos );
-               
+
                #return $sContent;
-               
+
                $sSummary = "Modified Check";
                $oContentHandler = $oContent->getContentHandler();
                $oNewContent = $oContentHandler->makeContent($sContent, 
$oWikiPage->getTitle());
@@ -129,7 +129,7 @@
 
                return 'true';
        }
-       
+
        public static function getOptionsList() {
                $oRequest = RequestContext::getMain()->getRequest();
                $sList = $oRequest->getVal( 'listId', '' );
@@ -150,25 +150,25 @@
                                        return reset($found);
                        }, $subject,$nth  );
        }
-       
+
        /**
         *
         * @param Parser $parser
-        * @return boolean 
+        * @return boolean
         */
        public function onParserFirstCallInit( &$parser ) {
                $parser->setHook( 'bs:checklist', array( &$this, 
'onMagicWordBsChecklist' ) );
                return true;
        }
-       
-               public function onBSExtendedEditBarBeforeEditToolbar( &$aRows, 
&$aButtonCfgs ) {
+
+       public function onBSExtendedEditBarBeforeEditToolbar( &$aRows, 
&$aButtonCfgs ) {
                
$this->getOutput()->addModuleStyles('ext.bluespice.checklist.styles');
                $this->getOutput()->addModules('ext.bluespice.checklist');
-               
+
                $aRows[0]['dialogs'][60] = 'bs-editbutton-checklist';
 
                $aButtonCfgs['bs-editbutton-checklist'] = array(
-                       'tip' => wfMessage( 'bs-checklist-menu_insert_checkbox' 
)->plain(),
+                       'tip' => wfMessage( 'bs-checklist-menu-insert-checkbox' 
)->plain(),
                        'open' => '<bs:checklist />'
                );
                return true;
@@ -183,17 +183,23 @@
        public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) {
                if( $type != 'tags' ) return true;
 
+               $aMessage = array();
+               $aMessage[] = wfMessage( 'bs-checklist-tag-checklist-desc' 
)->plain().'<br />';
+               $aMessage[] = wfMessage( 
'bs-checklist-tag-checklist-param-type' )->plain();
+               $aMessage[] = wfMessage( 
'bs-checklist-tag-checklist-param-list' )->plain();
+               $aMessage[] = wfMessage( 
'bs-checklist-tag-checklist-param-value' )->plain();
+
                $oResponse->result[] = array(
                        'id' => 'bs:checklist',
                        'type' => 'tag',
                        'name' => 'checklist',
-                       'desc' => wfMessage( 'bs-checklist-tag-checklist-desc' 
)->parse(),
+                       'desc' => implode( '<br />', $aMessage ),
                        'code' => '<bs:checklist />',
                );
 
                return true;
        }
-       
+
        public static function getListOptions( $listTitle ) {
                $aOptions = array();
                $oTitle = Title::newFromText( $listTitle );
@@ -219,14 +225,14 @@
                 *16:38:56: Und falls das nicht geht sollte ein 
$oTitle-&gt;invalidateCache(); den gleichen Effekt haben.
                 */
                $parser->disableCache();
-               
+
                $this->bCheckboxFound = true;
                $sOut = array();
-               
+
                if (isset($args['list'])) {
                        $aOptions = $this->getListOptions( $args['list'] );
                }
-               
+
                //$aOptions = array("grün", "blau", "gelb", "rot");
                $sSelectColor = '';
                if (isset($args['type']) && $args['type'] == 'list' ) {
@@ -234,14 +240,14 @@
                        $sOut[] = "id='".$this->getNewCheckboxId()."' ";
                        $sOut[] = "onchange='BsChecklist.change(this);' ";
                        $sOut[] = ">";
-                       
+
                        foreach ( $aOptions as $sOption ) {
                                $aOptionSet = explode("|", $sOption);
-                               
+
                                if (!$sSelectColor && isset ($aOptionSet[1])) {
                                        $sSelectColor = 
"style='color:".$aOptionSet[1].";' ";
                                }
-                               
+
                                $sOption = $aOptionSet[0];
                                $sOut[] = "<option ";
                                if (isset ($aOptionSet[1])) {
@@ -276,7 +282,7 @@
                $this->iCheckboxCounter++;
                return $this->iCheckboxCounter;
        }
-       
+
        /**
         * Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if 
needed.
         * @param OutputPage $oOutputPage
diff --git a/Checklist/Checklist.setup.php b/Checklist/Checklist.setup.php
index fad1b2d..557c9f0 100644
--- a/Checklist/Checklist.setup.php
+++ b/Checklist/Checklist.setup.php
@@ -12,11 +12,11 @@
 $wgResourceModules['ext.bluespice.checklist'] = array(
        'scripts' => 'bluespice.checklist.js',
        'messages' => array(
-               'bs-checklist-button_checkbox_title',
-               'bs-checklist-menu_insert_list_title',
-               'bs-checklist-menu_insert_checkbox',
-               'bs-checklist-dlg_insert_list_title',
-               'bs-checklist-dlg_insert_list_value_list',
+               'bs-checklist-button-checkbox-title',
+               'bs-checklist-menu-insert-list-title',
+               'bs-checklist-menu-insert-checkbox',
+               'bs-checklist-dlg-insert-list-title',
+               'bs-checklist-dlg-insert-list-value-list',
        )
 ) + $aResourceModuleTemplate;
 
diff --git a/Checklist/i18n/de.json b/Checklist/i18n/de.json
new file mode 100644
index 0000000..d363041
--- /dev/null
+++ b/Checklist/i18n/de.json
@@ -0,0 +1,17 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-checklist-desc": "Ermöglicht die Erstellug von Checklisten",
+       "bs-checklist-button-checkbox-title": "Checklistenelemente",
+       "bs-checklist-menu-insert-list-title": "Liste einfügen",
+       "bs-checklist-menu-insert-checkbox": "Checkbox",
+       "bs-checklist-dlg-insert-list-title": 
"{{int:bs-checklist-menu-insert-list-title}}",
+       "bs-checklist-dlg-insert-list-value-list": "Werteliste",
+       "bs-checklist-tag-checklist-desc": "Erstellt eine Checkbox oder 
Select-Menü. Verfügbare Konfigurationsparameter sind:",
+       "bs-checklist-tag-checklist-param-type": "<code>type</code>: 
<code>list<code> erstellt ein Select-Menü.",
+       "bs-checklist-tag-checklist-param-list": "<code>list</code>: Name der 
Vorlage, die die verfügbaren Werte beinhaltet. Parameter <code>type</code> mit 
dem Wert <code>list</code> muss gesetzt sein.",
+       "bs-checklist-tag-checklist-param-value": "<code>value</code>: 
<code>checked</code> oder ein Wert aus der Werte Vorlage."
+}
diff --git a/Checklist/i18n/en.json b/Checklist/i18n/en.json
new file mode 100644
index 0000000..296430c
--- /dev/null
+++ b/Checklist/i18n/en.json
@@ -0,0 +1,17 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-checklist-desc": "Provides checklist functionality",
+       "bs-checklist-button-checkbox-title": "Checklist elements",
+       "bs-checklist-menu-insert-list-title": "Insert list",
+       "bs-checklist-menu-insert-checkbox": "Checkbox",
+       "bs-checklist-dlg-insert-list-title": 
"{{int:bs-checklist-menu-insert-list-title}}",
+       "bs-checklist-dlg-insert-list-value-list": "Value list",
+       "bs-checklist-tag-checklist-desc": "Renders a checkbox or select field. 
Available configuration attributes:",
+       "bs-checklist-tag-checklist-param-type": "<code>type</code>: 
<code>list</code> renders a select list.",
+       "bs-checklist-tag-checklist-param-list": "<code>list</code>: Name of 
the template with the available values. Parameter <code>type</code> must be set 
to <code>list</code>.",
+       "bs-checklist-tag-checklist-param-value": "<code>value</code>: 
<code>checked</code> or a value out of the list template."
+}
diff --git a/Checklist/i18n/qqq.json b/Checklist/i18n/qqq.json
new file mode 100644
index 0000000..34cf4f1
--- /dev/null
+++ b/Checklist/i18n/qqq.json
@@ -0,0 +1,17 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-checklist-desc": "Used in 
[[Special:Wiki_Admin&mode=ExtensionInfo]], description of checklist extension",
+       "bs-checklist-button-checkbox-title": "Button text for checklist 
elements",
+       "bs-checklist-menu-insert-list-title": "Label for insert 
list\n{{Identical|Insert list}}",
+       "bs-checklist-menu-insert-checkbox": "Label for 
checkbox\n{{Identical|Checkbox}}",
+       "bs-checklist-dlg-insert-list-title": 
"{{int:bs-checklist-menu-insert-list-title}}",
+       "bs-checklist-dlg-insert-list-value-list": "Label for value 
list\n{{Identical|Value list}}",
+       "bs-checklist-tag-checklist-desc": "Text for renders a checkbox or 
select field. Available configuration attributes:",
+       "bs-checklist-tag-checklist-param-type": "Text for <code>type</code>: 
<code>list</code> renders a select list. \n \"type\" has to be lowercase",
+       "bs-checklist-tag-checklist-param-list": "Text for <code>list</code>: 
Name of the template with the available values. Parameter <code>type</code> 
must be set to <code>list</code>. \n \"list\" has to be lowercase",
+       "bs-checklist-tag-checklist-param-value": "Text for <code>value</code>: 
<code>checked</code> or a value out of the list template. \n \"value\" has to 
be lowercase"
+}
diff --git a/Checklist/languages/Checklist.i18n.php 
b/Checklist/languages/Checklist.i18n.php
index 1d8ad0f..b6f8035 100644
--- a/Checklist/languages/Checklist.i18n.php
+++ b/Checklist/languages/Checklist.i18n.php
@@ -1,61 +1,35 @@
 <?php
 /**
- * Internationalisation file for CountThings
+ * 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 <[email protected]>
-
- * @package    BlueSpice_Extensions
- * @subpackage CountThings
- * @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( 'wfJsonI18nShimbde1749ad8f1b7f9' ) ) {
+       function wfJsonI18nShimbde1749ad8f1b7f9( $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['de'] = array(
-       'bs-checklist-extension-description'                   => 'Ermöglicht 
die Benutzung von Checklisten.',
-       'Checklist'                                            => 'Checkliste',
+                       $cachedData['deps'][] = new FileDependency( $fileName );
+               }
+               return true;
+       }
 
-       /* JS */
-       'bs-checklist-button_checkbox_title'                   => 
'Checklistenelemente',
-       'bs-checklist-menu_insert_list_title'                  => 'Liste 
einfügen...',
-       'bs-checklist-menu_insert_checkbox'                    => 'Checkbox',
-       'bs-checklist-dlg_insert_list_title'                   => 'Liste 
einfügen',
-       'bs-checklist-dlg_insert_list_value_list'              => 'Werteliste',
-       
-       'bs-checklist-tag-checklist-desc' => 'Fügt einen Haken oder eine 
Auswahlliste in den Artikel ein
-
-Verfügbare Parameter:
-;type: <code>list</code>.
-;list: Name der Vorlage mit den Listeneinträgen.
-;value: <code>checked</code> oder der Wert aus der Liste.'
-);
-
-$messages['de-formal'] = array(
-
-);
-
-$messages['en'] = array(
-       'bs-checklist-extension-description'                 => 'Provides 
checklist functionality.',
-       'Checklist'                                          => 'Checklist',
-       
-/* JS */
-       'bs-checklist-button_checkbox_title'                   => 'Checklist 
elements',
-       'bs-checklist-menu_insert_list_title'                  => 'Insert 
list...',
-       'bs-checklist-menu_insert_checkbox'                    => 'Checkbox',
-       'bs-checklist-dlg_insert_list_title'                   => 'Insert list',
-       'bs-checklist-dlg_insert_list_value_list'              => 'Value list',
-       
-               'bs-checklist-tag-checklist-desc' => 'Adds a checkbox or select 
field to the articles content
-
-Valid attributes:
-;type: <code>list</code>.
-;list: Name of a Template with the list items.
-;value: <code>checked</code> or the list value.'
-       
-);
-
-$messages['qqq'] = array();
\ No newline at end of file
+       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimbde1749ad8f1b7f9';
+}
diff --git a/Checklist/resources/bluespice.checklist.js 
b/Checklist/resources/bluespice.checklist.js
index f21f0bc..b021ec4 100644
--- a/Checklist/resources/bluespice.checklist.js
+++ b/Checklist/resources/bluespice.checklist.js
@@ -243,7 +243,7 @@
        menus.push({
                menuId: 'bsChecklist',
                menuConfig: {
-                       text: 
mw.message('bs-checklist-menu_insert_checkbox').plain(),
+                       text: 
mw.message('bs-checklist-menu-insert-checkbox').plain(),
                        cmd : 'mceBsChecklistLastCommand'
                }
        });
@@ -253,7 +253,7 @@
        menuItems.push({text: '-'});
        
        menuItems.push({
-               text: mw.message('bs-checklist-button_checkbox_title').plain(),
+               text: mw.message('bs-checklist-button-checkbox-title').plain(),
                value: 'Checkbox',
                onclick:function(){
                        BsChecklist.lastCommand = 'mceBsCheckbox';
@@ -263,15 +263,15 @@
        });
        
        menuItems.push({
-               text: mw.message('bs-checklist-menu_insert_list_title').plain(),
+               text: mw.message('bs-checklist-menu-insert-list-title').plain(),
                onclick: function() {
                        // Open window
                        ed.windowManager.open({
-                               title: 
mw.message('bs-checklist-dlg_insert_list_title').plain(),
+                               title: 
mw.message('bs-checklist-dlg-insert-list-title').plain(),
                                body: [{
                                                type: 'textbox',
                                                name: 'title',
-                                               label: 
mw.message('bs-checklist-dlg_insert_list_value_list').plain()
+                                               label: 
mw.message('bs-checklist-dlg-insert-list-value-list').plain()
                                }],
                                onsubmit: function(e) {
                                        // Insert content when the window form 
is submitted
@@ -284,7 +284,7 @@
        });
        
        ed.addButton('bscheckbox', {
-               title: mw.message('bs-checklist-button_checkbox_title').plain(),
+               title: mw.message('bs-checklist-button-checkbox-title').plain(),
                cmd: 'mceBsChecklistLastCommand',
                type: 'splitbutton',
                //icon: 'image',

-- 
To view, visit https://gerrit.wikimedia.org/r/145523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fe67695e2791b7fde8353d7de48256d93e07033
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pigpen <[email protected]>
Gerrit-Reviewer: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to