Smuggli has submitted this change and it was merged.

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


Implemented changes for translatewiki

Moved php i18n file into languages folder
Moved to Json i18n files
Fixed typos

Change-Id: Ibc2844b060cc33e228ab002c632b036c775e87c2
---
M UEModulePDF/UEModulePDF.class.php
D UEModulePDF/UEModulePDF.i18n.php
M UEModulePDF/UEModulePDF.setup.php
A UEModulePDF/i18n/de-formal.json
A UEModulePDF/i18n/de.json
A UEModulePDF/i18n/en.json
A UEModulePDF/i18n/qqq.json
M UEModulePDF/includes/ExportModulePDF.class.php
A UEModulePDF/languages/UEModulePDF.i18n.php
9 files changed, 123 insertions(+), 82 deletions(-)

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



diff --git a/UEModulePDF/UEModulePDF.class.php 
b/UEModulePDF/UEModulePDF.class.php
index d296fef..7866211 100644
--- a/UEModulePDF/UEModulePDF.class.php
+++ b/UEModulePDF/UEModulePDF.class.php
@@ -82,12 +82,12 @@
        protected function initExt() {
                wfProfileIn( 'BS::'.__METHOD__ );
                //Variables
-               BsConfig::registerVar( 'MW::UEModulePDF::PdfServiceURL',   
'http://localhost:8080/BShtml2PDF', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING, 
'bs-uemodulepdf-pref-PdfServiceURL' );
-               BsConfig::registerVar( 'MW::UEModulePDF::DefaultTemplate', 
'BlueSpice', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-uemodulepdf-pref-DefaultTemplate' );
-               BsConfig::registerVar( 'MW::UEModulePDF::SuppressNS',      
false,       BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-uemodulepdf-pref-SuppressNS', 'toggle' );
+               BsConfig::registerVar( 'MW::UEModulePDF::PdfServiceURL',   
'http://localhost:8080/BShtml2PDF', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING, 
'bs-uemodulepdf-pref-pdfserviceurl' );
+               BsConfig::registerVar( 'MW::UEModulePDF::DefaultTemplate', 
'BlueSpice', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-uemodulepdf-pref-templatepath' );
+               BsConfig::registerVar( 'MW::UEModulePDF::SuppressNS',      
false,       BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-uemodulepdf-pref-suppressns', 'toggle' );
                /* This setting is no longer needed. We do not provide the old 
bn2pdf.war anymore */
-               BsConfig::registerVar( 'MW::UEModulePDF::Backend',        
'BsPDFServlet', 
BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-uemodulepdf-pref-Backend' );
-               BsConfig::registerVar( 'MW::UEModulePDF::TemplatePath',   
'extensions/BlueSpiceFoundation/data/PDFTemplates', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING, 
'bs-uemodulepdf-pref-TemplatePath' );
+               BsConfig::registerVar( 'MW::UEModulePDF::Backend',        
'BsPDFServlet', 
BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS );
+               BsConfig::registerVar( 'MW::UEModulePDF::TemplatePath',   
'extensions/BlueSpiceFoundation/data/PDFTemplates', 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING, 
'bs-uemodulepdf-pref-templatepath' );
 
                //Hooks
                $this->setHook('BSUniversalExportGetWidget');
diff --git a/UEModulePDF/UEModulePDF.i18n.php b/UEModulePDF/UEModulePDF.i18n.php
deleted file mode 100644
index 0096bbb..0000000
--- a/UEModulePDF/UEModulePDF.i18n.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * Internationalisation file for UEModulePDF
- *
- * Part of BlueSpice for MediaWiki
- *
- * @author     Stephan Muggli <[email protected]>
-
- * @package    BlueSpice_Extensions
- * @subpackage UEModulePDF
- * @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
- */
-
-$messages = array();
-
-$messages['en'] = array(
-       'UEModulePDF'                                           => 
'UniversalExport PDF Module',
-       'prefs-UEModulePDF'                                     => 
'UniversalExport PDF Module',
-       'bs-uemodulepdf-extension-description'                  => 'Enables 
export to PDF',
-       'bs-uemodulepdf-pref-PdfServiceURL'                     => 'Backend 
URL',
-       'bs-uemodulepdf-pref-PDFenNS'                           => 'Link for 
"PDF single page"',
-       'bs-uemodulepdf-pref-PDFwithATTenNS'                    => 'Link for 
"PDF single page with attachments"',
-       'bs-uemodulepdf-pref-TemplatePath'                      => 'Path to 
templates',
-       'bs-uemodulepdf-pref-DefaultTemplate'                   => 'Standard 
template',
-       'bs-uemodulepdf-pref-SuppressNS'                        => 'Hide 
namespace prefix in PDF',
-       'bs-uemodulepdf-pref-Backend'                           => 'Backend',
-       'bs-uemodulepdf-widgetlink-single-no-attachments-text'  => 'PDF single 
page',
-       'bs-uemodulepdf-widgetlink-single-no-attachments-title' => 'Export this 
page as PDF.',
-       'bs-uemodulepdf-overview-title'                         => 'Adobe&reg; 
Portable Document Format (PDF)',
-       'bs-uemodulepdf-overview-description'                   => 'Exports 
pages (SpecialPages and ContenPages) to Adobe PDF.',
-       'bs-uemodulepdf-overview-webservice-state'              => 'Backend 
state',
-       'bs-uemodulepdf-overview-webservice-state-ok'           => 'available',
-       'bs-uemodulepdf-overview-webservice-state-not-ok'       => 'not 
available',
-       'soap-service-url-not-valid'                            => 'The URL to 
the PDF generating web serivce is not valid. Please check the wiki 
configuration.',
-       'soap-service-url-not-set'                              => 'The URL to 
the PDF generating web serivce is not set. Please check the wiki 
configuration.',
-       'bs-uemodulepdf-overview-webservice-webadmin'           => 'Backend 
webinterface',
-       'bs-universalexport-fs-pagemode'                        => 'PDF page 
mode',
-       'bs-universalexport-fs-pagelayout'                      => 'PDF layout',
-       'bs-universalexport-template'                           => 'PDF 
template',
-);
-
-$messages['de'] = array(
-       'UEModulePDF'                                           => 
'UniversalExport PDF Modul',
-       'prefs-UEModulePDF'                                     => 
'UniversalExport PDF Modul',
-       'extension-description'                                 => 'Ermöglicht 
das Exportieren nach PDF',
-       'bs-uemodulepdf-pref-PdfServiceURL'                     => 'Backend 
URL',
-       'bs-uemodulepdf-pref-PDFenNS'                           => 'Link für 
"PDF Einzelseite"',
-       'bs-uemodulepdf-pref-PDFwithATTenNS'                    => 'Link für 
"PDF Einzelseite mit Dateianhängen"',
-       'bs-uemodulepdf-pref-TemplatePath'                      => 'Pfad zu den 
Vorlagen',
-       'bs-uemodulepdf-pref-DefaultTemplate'                   => 
'Standardvorlage',
-       'bs-uemodulepdf-pref-SuppressNS'                        => 'Namensraum 
im PDF ausblenden',
-       'bs-uemodulepdf-widgetlink-single-no-attachments-text'  => 'PDF 
Einzelseite',
-       'bs-uemodulepdf-widgetlink-single-no-attachments-title' => 'Diese Seite 
im PDF Format ausgeben.',
-       'bs-uemodulepdf-overview-title'                         => 'Adobe&reg; 
Portable Document Format (PDF)',
-       'bs-uemodulepdf-overview-description'                   => 'Exportiert 
Wikiseiten (Spezialseiten und Inhaltsseiten) nach Adobe PDF.',
-       'bs-uemodulepdf-overview-webservice-state'              => 'Status des 
Backends',
-       'bs-uemodulepdf-overview-webservice-state-ok'           => 'erreichbar',
-       'bs-uemodulepdf-overview-webservice-state-not-ok'       => 'nicht 
erreichbar',
-       'soap-service-url-not-valid'                            => 'Die Adresse 
des Webservices für die PDF-Erzeugung ist nicht korrekt. Bitte überprüfe die 
Wiki-Einstellungen.',
-       'soap-service-url-not-set'                              => 'Die Adresse 
des Webservices für die PDF-Erzeugung ist nicht gesetzt. Bitte überprüfe die 
Wiki-Einstellungen.',
-       'bs-uemodulepdf-overview-webservice-webadmin'           => 'Backend 
Webinterface',
-       'bs-universalexport-fs-pagemode'                        => 'PDF 
Seitenmodus',
-       'bs-universalexport-fs-pagelayout'                      => 'PDF Layout',
-       'bs-universalexport-template'                           => 'PDF 
Vorlage',
-);
-
-$messages['de-formal'] = array(
-               'soap-service-url-not-valid' => 'Die Adresse des Webservices 
für die PDF-Erzeugung ist nicht korrekt. Bitte überprüfen Sie die 
Wiki-Einstellungen.',
-               'soap-service-url-not-set'   => 'Die Adresse des Webservices 
für die PDF-Erzeugung ist nicht gesetzt. Bitte überprüfen Sie die 
Wiki-Einstellungen.',
-);
-
-$messages['qqq'] = array();
\ No newline at end of file
diff --git a/UEModulePDF/UEModulePDF.setup.php 
b/UEModulePDF/UEModulePDF.setup.php
index 1bd1aab..79a5fda 100644
--- a/UEModulePDF/UEModulePDF.setup.php
+++ b/UEModulePDF/UEModulePDF.setup.php
@@ -1,10 +1,12 @@
 <?php
 
-BsExtensionManager::registerExtension('UEModulePDF', 
BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE, BsACTION::LOAD_SPECIALPAGE);
+BsExtensionManager::registerExtension( 'UEModulePDF', 
BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE, BsACTION::LOAD_SPECIALPAGE );
 
 $bsgUEModulePDFCURLOptions = array();
 
-$wgExtensionMessagesFiles['UEModulePDF'] = __DIR__ . '/UEModulePDF.i18n.php';
+$wgMessagesDirs['UEModulePDF'] = __DIR__ . '/i18n';
+
+$wgExtensionMessagesFiles['UEModulePDF'] = __DIR__ . 
'/languages/UEModulePDF.i18n.php';
 
 $GLOBALS['wgAutoloadClasses']['UEModulePDF'] = __DIR__ . 
'/UEModulePDF.class.php';
 $wgAutoloadClasses['BsPDFPageProvider'] = __DIR__ . 
'/includes/PDFPageProvider.class.php';
diff --git a/UEModulePDF/i18n/de-formal.json b/UEModulePDF/i18n/de-formal.json
new file mode 100644
index 0000000..b54582c
--- /dev/null
+++ b/UEModulePDF/i18n/de-formal.json
@@ -0,0 +1,9 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "soap-service-url-not-valid": "Die URL des Webservices für die 
PDF-Erzeugung ist nicht korrekt. Bitte überprüfen Sie die Wiki-Einstellungen.",
+       "soap-service-url-not-set": "Die URL des Webservices für die 
PDF-Erzeugung ist nicht gesetzt. Bitte überprüfen Sie die Wiki-Einstellungen."
+}
diff --git a/UEModulePDF/i18n/de.json b/UEModulePDF/i18n/de.json
new file mode 100644
index 0000000..da11641
--- /dev/null
+++ b/UEModulePDF/i18n/de.json
@@ -0,0 +1,23 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-uemodulepdf-desc": "Ermöglicht das Exportieren nach PDF",
+       "prefs-uemodulepdf": "Universal Export PDF Modul",
+       "uemodulepdf": "Universal Export PDF Modul",
+       "bs-uemodulepdf-pref-pdfserviceurl": "Backend URL:",
+       "bs-uemodulepdf-pref-templatepath": "Standardvorlage:",
+       "bs-uemodulepdf-pref-suppressns": "Namensraum im PDF ausblenden",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-text": "PDF 
Einzelseite",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-title": "Diese Seite 
im PDF Format ausgeben.",
+       "bs-uemodulepdf-overview-title": "Portable Document Format (PDF)",
+       "bs-uemodulepdf-overview-desc": "Exportiert Wikiseiten (Spezialseiten 
und Inhaltsseiten) nach Adobe PDF.",
+       "bs-uemodulepdf-overview-webservice-state": "Status des Backends",
+       "bs-uemodulepdf-overview-webservice-state-ok": "erreichbar",
+       "bs-uemodulepdf-overview-webservice-state-not-ok": "nicht erreichbar",
+       "soap-service-url-not-valid": "Die URL des Webservices für die 
PDF-Erzeugung ist nicht korrekt. Bitte überprüfe die Wiki-Einstellungen.",
+       "soap-service-url-not-set": "Die URL des Webservices für die 
PDF-Erzeugung ist nicht gesetzt. Bitte überprüfe die Wiki-Einstellungen.",
+       "bs-uemodulepdf-overview-webservice-webadmin": "Backend Webinterface"
+}
diff --git a/UEModulePDF/i18n/en.json b/UEModulePDF/i18n/en.json
new file mode 100644
index 0000000..904e0ab
--- /dev/null
+++ b/UEModulePDF/i18n/en.json
@@ -0,0 +1,23 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-uemodulepdf-desc": "Enables export to PDF",
+       "prefs-uemodulepdf": "Universal export PDF module",
+       "uemodulepdf": "Universal export PDF module",
+       "bs-uemodulepdf-pref-pdfserviceurl": "Backend URL:",
+       "bs-uemodulepdf-pref-templatepath": "Standard template:",
+       "bs-uemodulepdf-pref-suppressns": "Hide namespace prefix in PDF",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-text": "PDF single 
page",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-title": "Export this 
page as PDF.",
+       "bs-uemodulepdf-overview-title": "Portable Document Format (PDF)",
+       "bs-uemodulepdf-overview-desc": "Exports pages (special pages and 
content pages) to PDF.",
+       "bs-uemodulepdf-overview-webservice-state": "Backend state",
+       "bs-uemodulepdf-overview-webservice-state-ok": "available",
+       "bs-uemodulepdf-overview-webservice-state-not-ok": "not available",
+       "soap-service-url-not-valid": "The URL to the PDF generating web 
service is not valid. Please check the wiki configuration.",
+       "soap-service-url-not-set": "The URL to the PDF generating web service 
is not set. Please check the wiki configuration.",
+       "bs-uemodulepdf-overview-webservice-webadmin": "Backend web interface"
+}
diff --git a/UEModulePDF/i18n/qqq.json b/UEModulePDF/i18n/qqq.json
new file mode 100644
index 0000000..ec627e3
--- /dev/null
+++ b/UEModulePDF/i18n/qqq.json
@@ -0,0 +1,23 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Stephan Muggli <[email protected]>"
+               ]
+       },
+       "bs-uemodulepdf-desc": "Used in 
[[Special:Wiki_Admin&mode=ExtensionInfo]], description of UEModulePDF extension 
\n UEModulePDF stands for Universal Export Module PDF",
+       "prefs-uemodulepdf": "Used in [[Special:Wiki_Admin&mode=Preferences]], 
headline for universal export PDF module",
+       "uemodulepdf": "Special page name for universal export PDF module \n 
{{Identical|Universal export PDF module}}",
+       "bs-uemodulepdf-pref-pdfserviceurl": "Option in 
[[Special:Wiki_Admin&mode=Preferences]], label text for backend URL:",
+       "bs-uemodulepdf-pref-templatepath": "Option in 
[[Special:Wiki_Admin&mode=Preferences]], label text for standard template:",
+       "bs-uemodulepdf-pref-suppressns": "Option in 
[[Special:Wiki_Admin&mode=Preferences]], checkbox label text for hide namespace 
prefix in PDF",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-text": "Text for PDF 
single page",
+       "bs-uemodulepdf-widgetlink-single-no-attachments-title": "Text for 
export this page as PDF.",
+       "bs-uemodulepdf-overview-title": "Text for Portable Document Format 
(PDF) \n {{Identical|Portable Document Format (PDF)}}",
+       "bs-uemodulepdf-overview-desc": "Text for exports pages (special pages 
and content pages) to PDF.",
+       "bs-uemodulepdf-overview-webservice-state": "Text for backend state",
+       "bs-uemodulepdf-overview-webservice-state-ok": "Text for available",
+       "bs-uemodulepdf-overview-webservice-state-not-ok": "Text for not 
available",
+       "soap-service-url-not-valid": "Text for the URL to the PDF generating 
web service is not valid. Please check the wiki configuration.",
+       "soap-service-url-not-set": "Text for the URL to the PDF generating web 
service is not set. Please check the wiki configuration.",
+       "bs-uemodulepdf-overview-webservice-webadmin": "Text for backend web 
interface"
+}
diff --git a/UEModulePDF/includes/ExportModulePDF.class.php 
b/UEModulePDF/includes/ExportModulePDF.class.php
index 92bb549..0eec30b 100644
--- a/UEModulePDF/includes/ExportModulePDF.class.php
+++ b/UEModulePDF/includes/ExportModulePDF.class.php
@@ -146,7 +146,7 @@
                $oModuleOverviewView = new ViewExportModuleOverview();
 
                $oModuleOverviewView->setOption( 'module-title', wfMessage( 
'bs-uemodulepdf-overview-title' )->plain() );
-               $oModuleOverviewView->setOption( 'module-description', 
wfMessage( 'bs-uemodulepdf-overview-description' )->plain() );
+               $oModuleOverviewView->setOption( 'module-description', 
wfMessage( 'bs-uemodulepdf-overview-desc' )->plain() );
                $oModuleOverviewView->setOption( 'module-bodycontent', '' );
 
                $oWebserviceStateView = new ViewBaseElement();
diff --git a/UEModulePDF/languages/UEModulePDF.i18n.php 
b/UEModulePDF/languages/UEModulePDF.i18n.php
new file mode 100644
index 0000000..b04dd0a
--- /dev/null
+++ b/UEModulePDF/languages/UEModulePDF.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( 'wfJsonI18nShim86d8dc9b79870421' ) ) {
+       function wfJsonI18nShim86d8dc9b79870421( $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'][] = 
'wfJsonI18nShim86d8dc9b79870421';
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc2844b060cc33e228ab002c632b036c775e87c2
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]>
Gerrit-Reviewer: Smuggli <[email protected]>

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

Reply via email to