Smuggli has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149027

Change subject: Implemented changes for translatewiki
......................................................................

Implemented changes for translatewiki

Moved to Json i18n files

Change-Id: Iaf3a8e44fe0a1ec89978a9464fb4afed1e67b3f9
---
M BlueSpiceSkin.i18n.php
M BlueSpiceSkin.php
A i18n/de.json
A i18n/en.json
A i18n/qqq.json
M views/view.StateBarTopElementTools.php
6 files changed, 71 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin 
refs/changes/27/149027/1

diff --git a/BlueSpiceSkin.i18n.php b/BlueSpiceSkin.i18n.php
index ec79023..a534e15 100644
--- a/BlueSpiceSkin.i18n.php
+++ b/BlueSpiceSkin.i18n.php
@@ -1,35 +1,35 @@
 <?php
 /**
- * Internationalization file for skin BlueSpiceSkin.
+ * This is a backwards-compatibility shim, generated by:
+ * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
  *
- * @file
- * @ingroup Skins
+ * 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();
-$messages['en'] = array(
-       'bs-my-account' => 'Profile',
-       'bs-tools-widgets-headline' => 'WIDGETS',
-       'bs-tools-headline' => 'Page tools',
-       'bs-tools-button' => 'MORE',
-       'bs-watch' => 'watch',
-       'bs-top-bar-settings' => 'My Settings',
-       'bs-top-bar-messages' => '{{PLURAL:$1|Message|Messages}}',
-       'bs-top-bar-review' => '$1 {{PLURAL:$1|Review|Reviews}}',
-       'bs-topbar-profile' => 'Userpage',
-       'bs-title-actions-print-text' => 'Print',
-       'bs-title-actions-print-title' => 'Opens printer friendly styling of 
the page'
-);
-$messages['de'] = array(
-       'bs-my-account' => 'Profil',
-       'bs-tools-widgets-headline' => 'WIDGETS',
-       'bs-tools-headline' => 'Seiten-Werkzeuge',
-       'bs-tools-button' => 'MEHR',
-       'bs-watch' => 'beobachten',
-       'bs-top-bar-settings' => 'Meine Einstellungen',
-       'bs-top-bar-messages' => '$1 {{PLURAL:$1|Nachricht|Nachrichten}}',
-       'bs-top-bar-review' => '$1 {{PLURAL:$1|Begutachtung|Begutachtungen}}',
-       'bs-topbar-profile' => 'Benutzerseite',
-       'bs-title-actions-print-text' => 'Druckansicht',
-       'bs-title-actions-print-title' => 'Öffnet die für den Ausdruck 
optimierte Ansicht der Seite'
-);
\ No newline at end of file
+if ( !function_exists( 'wfJsonI18nShime82f6ce41a6a4c2e' ) ) {
+       function wfJsonI18nShime82f6ce41a6a4c2e( $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'][] = 
'wfJsonI18nShime82f6ce41a6a4c2e';
+}
diff --git a/BlueSpiceSkin.php b/BlueSpiceSkin.php
index c778060..023cfc1 100644
--- a/BlueSpiceSkin.php
+++ b/BlueSpiceSkin.php
@@ -28,6 +28,8 @@
 $wgAutoloadClasses['ViewStateBarTopElementTools'] = __DIR__ . 
'/views/view.StateBarTopElementTools.php';
 $wgAutoloadClasses['ViewStateBarTopElementWatch'] = __DIR__ . 
'/views/view.StateBarTopElementWatch.php';
 
+$wgMessagesDirs['BlueSpiceSkin'] = __DIR__ . '/i18n';
+
 $wgExtensionMessagesFiles['BlueSpiceSkin'] = __DIR__ . 
'/BlueSpiceSkin.i18n.php';
 
 //$wgHooks['BSStateBarBeforeTopViewAdd'][] = 
"BlueSpiceSkinHooks::onBSStateBarBeforeTopViewAdd";
@@ -56,10 +58,6 @@
                'ext.bluespice',
                'mediawiki.jqueryMsg',
                'jquery.ui.tabs',
-       ),
-       'messages' => array(
-               'bs-top-bar-messages',
-               'bs-top-bar-review'
        ),
 ) + $aResourceModuleTemplate;
 
diff --git a/i18n/de.json b/i18n/de.json
new file mode 100644
index 0000000..d5c45dc
--- /dev/null
+++ b/i18n/de.json
@@ -0,0 +1,12 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <mug...@hallowelt.biz>"
+               ]
+       },
+       "bluespiceskin-desc": "Skin der BlueSpice Erweiterung",
+       "bs-tools-widgets-headline": "WIDGETS",
+       "bs-tools-button": "MEHR",
+       "bs-title-actions-print-text": "Druckansicht",
+       "bs-title-actions-print-title": "Öffnet die für den Ausdruck optimierte 
Ansicht der Seite"
+}
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 0000000..6602000
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,12 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <mug...@hallowelt.biz>"
+               ]
+       },
+       "bluespiceskin-desc": "Skin of the BlueSpice extension",
+       "bs-tools-widgets-headline": "WIDGETS",
+       "bs-tools-button": "MORE",
+       "bs-title-actions-print-text": "Print",
+       "bs-title-actions-print-title": "Displays printable version of the page"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
new file mode 100644
index 0000000..d01a0d1
--- /dev/null
+++ b/i18n/qqq.json
@@ -0,0 +1,12 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <mug...@hallowelt.biz>"
+               ]
+       },
+       "bluespiceskin-desc": "Used in [[Special:Version]], description of 
bluespice skin",
+       "bs-tools-widgets-headline": "Headline of widget container\n*completely 
uppercase\n*{{Identical|WIDGETS}}",
+       "bs-tools-button": "Anchor alternativ text for more\n*completely 
uppercase\n*{{Identical|MORE}}",
+       "bs-title-actions-print-text": "Anchor alternativ text for print",
+       "bs-title-actions-print-title": "Anchor title for displays printable 
version of the page"
+}
diff --git a/views/view.StateBarTopElementTools.php 
b/views/view.StateBarTopElementTools.php
index 2ec1b5a..5273e97 100644
--- a/views/view.StateBarTopElementTools.php
+++ b/views/view.StateBarTopElementTools.php
@@ -38,13 +38,13 @@
                $aOut[] = "<div id='bs-tools'>";
                        $aOut[] = "<div id='bs-tools-btn'>";
                                $aOut[] = "<div id='bs-tools-img'></div>";
-                               $aOut[] = "<span>".wfMessage( 'bs-tools-button' 
)->escaped()."</span>";
+                               $aOut[] = "<span>".wfMessage( 'bs-tools-button' 
)->plain()."</span>";
                        $aOut[] = "</div>";
                        $aOut[] = "<div id='bs-tools-container'>";
                                $aOut[] = "<div id='bs-tools-top'>";
                                        $aOut[] = "<div 
id='bs-tools-shadow-left'></div>";
                                        $aOut[] = "<div id='bs-tools-widgets'>";
-                                               $aOut[] = "<h3 
id='bs-tools-widgets-headline' class='bs-tools-headline'>" . 
wfMessage('bs-tools-widgets-headline')->escaped()."</h3>";
+                                               $aOut[] = "<h3 
id='bs-tools-widgets-headline' class='bs-tools-headline'>" . 
wfMessage('bs-tools-widgets-headline')->plain()."</h3>";
                                                $aOut[] = "<div 
id='bs-tools-widgets-column-0' class='bs-tools-widgets-column'></div>";
                                                $aOut[] = "<div 
id='bs-tools-widgets-column-1' class='bs-tools-widgets-column'></div>";
                                                $aOut[] = "<div 
id='bs-tools-widgets-column-2' class='bs-tools-widgets-column'></div>";
@@ -58,7 +58,7 @@
 
                                        $aOut[ ] = '<div id="bs-tools-more">';
                                                $aOut[ ] = "<div 
class='bs-widget-head'>";
-                                                       $aOut[ ] = "<h5 
class='bs-widget-title '>" . wfMessage( 'bs-tools-headline' 
)->escaped()."</h5>";
+                                                       $aOut[ ] = "<h5 
class='bs-widget-title '>" . wfMessage( 'bs-tools-headline' )->plain()."</h5>";
                                                $aOut[ ] = "</div>";
                                                $aOut[ ] = '<ul 
id="ca-more-menu">';
                                                $aOut[ ] = implode( "\n", 
$this->mOptions['skinTemplate']->data['more_menu'] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf3a8e44fe0a1ec89978a9464fb4afed1e67b3f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Smuggli <mug...@hallowelt.biz>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to