Smuggli has uploaded a new change for review.
https://gerrit.wikimedia.org/r/139823
Change subject: Implemented changes for translatewiki
......................................................................
Implemented changes for translatewiki
Moved to Json i18n files
Change-Id: Ie8231d4a73ac299392b3975634fe2a54d300831b
---
M PagesVisited/PagesVisited.class.php
M PagesVisited/PagesVisited.setup.php
A PagesVisited/i18n/de-formal.json
A PagesVisited/i18n/de.json
A PagesVisited/i18n/en.json
A PagesVisited/i18n/qqq.json
M PagesVisited/languages/PagesVisited.i18n.php
7 files changed, 101 insertions(+), 73 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/23/139823/1
diff --git a/PagesVisited/PagesVisited.class.php
b/PagesVisited/PagesVisited.class.php
index a8c4d7a..ca4cec9 100644
--- a/PagesVisited/PagesVisited.class.php
+++ b/PagesVisited/PagesVisited.class.php
@@ -90,9 +90,9 @@
$this->setHook( 'BSWidgetListHelperInitKeyWords' );
$this->setHook( 'BSInsertMagicAjaxGetData' );
- BsConfig::registerVar( 'MW::PagesVisited::WidgetLimit',
10, BsConfig::LEVEL_USER|BsConfig::TYPE_INT,
'bs-pagesvisited-pref-WidgetLimit', 'int' );
- BsConfig::registerVar( 'MW::PagesVisited::WidgetNS', array(
0 ),
BsConfig::LEVEL_USER|BsConfig::TYPE_ARRAY_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-pagesvisited-pref-WidgetNS', 'multiselectex' );
- BsConfig::registerVar( 'MW::PagesVisited::WidgetSortOdr',
'time',
BsConfig::LEVEL_USER|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-pagesvisited-pref-WidgetSortOdr', 'select' );
+ BsConfig::registerVar( 'MW::PagesVisited::WidgetLimit', 10,
BsConfig::LEVEL_USER|BsConfig::TYPE_INT, 'bs-pagesvisited-pref-widgetlimit',
'int' );
+ BsConfig::registerVar( 'MW::PagesVisited::WidgetNS', array( 0
),
BsConfig::LEVEL_USER|BsConfig::TYPE_ARRAY_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-pagesvisited-pref-widgetns', 'multiselectex' );
+ BsConfig::registerVar( 'MW::PagesVisited::WidgetSortOdr',
'time',
BsConfig::LEVEL_USER|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-pagesvisited-pref-widgetsortodr', 'select' );
wfProfileOut( 'BS::'.__METHOD__ );
}
@@ -108,7 +108,7 @@
switch( $oVariable->getName() ) {
case 'WidgetNS':
$aPrefs = array(
- 'type' => 'multiselectex',
+ 'type' => 'multiselectex',
'options' =>
BsNamespaceHelper::getNamespacesForSelectOptions( array( -2, NS_MEDIA,
NS_MEDIAWIKI, NS_MEDIAWIKI_TALK, NS_SPECIAL ) )
);
break;
@@ -148,7 +148,6 @@
/**
* Event-Handler for 'MW::Utility::WidgetListHelper::InitKeywords'.
Registers a callback for the PAGESVISITED Keyword.
- * @param BsEvent $oEvent The Event object
* @param array $aKeywords An array of Keywords array( 'KEYWORD' =>
$callable )
* @return array The appended array of Keywords array( 'KEYWORD' =>
$callable )
*/
@@ -163,7 +162,7 @@
* @return bool Always true to keep hook running.
*/
public function onParserFirstCallInit( &$oParser ) {
- $oParser->setHook( 'pagesvisited', array( $this,
'onPagesVisitedTag' ) );
+ $oParser->setHook( 'pagesvisited', array( $this,
'onPagesVisitedTag' ) );
$oParser->setHook( 'bs:pagesvisited', array( $this,
'onPagesVisitedTag' ) );
return true;
}
@@ -179,10 +178,10 @@
$oParser->disableCache();
$oErrorListView = new ViewTagErrorList( $this );
- $iCount = BsCore::sanitizeArrayEntry( $aAttributes, 'count',
5, BsPARAMTYPE::INT );
- $iMaxTitleLength = BsCore::sanitizeArrayEntry( $aAttributes,
'maxtitlelength', 20, BsPARAMTYPE::INT );
- $sNamespaces = BsCore::sanitizeArrayEntry( $aAttributes,
'namespaces', 'all', BsPARAMTYPE::STRING | BsPARAMOPTION::CLEANUP_STRING );
- $sSortOrder = BsCore::sanitizeArrayEntry( $aAttributes,
'order', 'time', BsPARAMTYPE::STRING | BsPARAMOPTION::CLEANUP_STRING );
+ $iCount = BsCore::sanitizeArrayEntry( $aAttributes, 'count', 5,
BsPARAMTYPE::INT );
+ $iMaxTitleLength = BsCore::sanitizeArrayEntry( $aAttributes,
'maxtitlelength', 20, BsPARAMTYPE::INT );
+ $sNamespaces = BsCore::sanitizeArrayEntry( $aAttributes,
'namespaces', 'all', BsPARAMTYPE::STRING | BsPARAMOPTION::CLEANUP_STRING );
+ $sSortOrder = BsCore::sanitizeArrayEntry( $aAttributes,
'order', 'time', BsPARAMTYPE::STRING | BsPARAMOPTION::CLEANUP_STRING );
//Validation
$oValidationICount = BsValidator::isValid( 'IntegerRange',
$iCount, array('fullResponse' => true, 'lowerBoundary' => 1, 'upperBoundary' =>
30) );
@@ -245,15 +244,12 @@
$iCount = BsConfig::get( 'MW::PagesVisited::WidgetLimit' );
$aNamespaces = BsConfig::get( 'MW::PagesVisited::WidgetNS' );
$sSortOrder = BsConfig::get( 'MW::PagesVisited::WidgetSortOdr'
);
- $iCurrentNamespaceId = 0;
//Validation
$oValidationICount = BsValidator::isValid( 'IntegerRange',
$iCount, array( 'fullResponse' => true, 'lowerBoundary' => 1, 'upperBoundary'
=> 30 ) );
if ( $oValidationICount->getErrorCode() ) $iCount = 10;
- if ( $this->getTitle() !== null ) { // TODO RBV (15.04.11
13:05): Necessary?
- $iCurrentNamespaceId =
$this->getTitle()->getNamespace();
- }
+ $iCurrentNamespaceId = $this->getTitle()->getNamespace();
// TODO RBV (04.07.11 15:02): Rework method -> implode() is a
workaround for legacy code.
$oListView = $this->makePagesVisitedWikiList( $iCount, implode(
',',$aNamespaces ), $iCurrentNamespaceId, 19, $sSortOrder );
@@ -298,11 +294,9 @@
$oVisitedPagesListView = new ViewBaseElement();
$oVisitedPagesListView->setTemplate(
'<ul><li><em>{TEXT}</em></li></ul>' . "\n" );
- if( count( $aInvalidNamespaces ) > 1 ) {
- $sErrorMsg = wfMessage(
'bs-pagesvisited-error-namespaces-not-valid', implode( ',', $aInvalidNamespaces
) )->plain();
- } else {
- $sErrorMsg = wfMessage(
'bs-pagesvisited-error-namespace-not-valid', $aInvalidNamespaces[0] )->plain();
- }
+ $iCount = count( $aInvalidNamespaces );
+ $sNs = implode( ', ', $aInvalidNamespaces );
+ $sErrorMsg = wfMessage(
'bs-pagesvisited-error-nsnotvalid', $iCount, $sNs )->text();
$oVisitedPagesListView->addData( array ( 'TEXT' =>
$sErrorMsg ) );
diff --git a/PagesVisited/PagesVisited.setup.php
b/PagesVisited/PagesVisited.setup.php
index 7e22870..053bd0a 100644
--- a/PagesVisited/PagesVisited.setup.php
+++ b/PagesVisited/PagesVisited.setup.php
@@ -2,4 +2,6 @@
BsExtensionManager::registerExtension( 'PagesVisited',
BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE );
+$wgMessagesDirs['PagesVisited'] = __DIR__ . '/i18n';
+
$wgExtensionMessagesFiles['PagesVisited'] = __DIR__ .
'/languages/PagesVisited.i18n.php';
\ No newline at end of file
diff --git a/PagesVisited/i18n/de-formal.json b/PagesVisited/i18n/de-formal.json
new file mode 100644
index 0000000..d1bea91
--- /dev/null
+++ b/PagesVisited/i18n/de-formal.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-pagesvisited-tag-pagesvisited-desc": "Gibt eine Liste mit Seiten
aus, die Sie besucht haben."
+}
diff --git a/PagesVisited/i18n/de.json b/PagesVisited/i18n/de.json
new file mode 100644
index 0000000..1c3bd93
--- /dev/null
+++ b/PagesVisited/i18n/de.json
@@ -0,0 +1,17 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-pagesvisited-desc": "Stellt eine personalisierte Liste der zuletzt
besuchten Seiten zur Verfügung",
+ "prefs-pagesvisited": "Besuchte Seiten",
+ "bs-pagesvisited-widget-title": "Besuchte Seiten",
+ "bs-pagesvisited-error-nsnotvalid": "{{PLURAL:$1|Der|Die}}
angegebene{{PLURAL:$1||n}} Namens{{PLURAL:$1|raum|räume}} <code>$2</code>
{{PLURAL:$1|ist|sind}} nicht gültig.",
+ "bs-pagesvisited-pref-widgetlimit": "Anzahl der Einträge:",
+ "bs-pagesvisited-pref-widgetns": "Anzuzeigende Namensräume:",
+ "bs-pagesvisited-pref-widgetsortodr": "Sortieren nach:",
+ "bs-pagesvisited-pref-sort-time": "Zeit",
+ "bs-pagesvisited-pref-sort-pagename": "Titel",
+ "bs-pagesvisited-tag-pagesvisited-desc": "Gibt eine Liste mit Seiten
aus, die du besucht hast."
+}
diff --git a/PagesVisited/i18n/en.json b/PagesVisited/i18n/en.json
new file mode 100644
index 0000000..c15f938
--- /dev/null
+++ b/PagesVisited/i18n/en.json
@@ -0,0 +1,17 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-pagesvisited-desc": "Provides a personalized list of the last
visited pages",
+ "prefs-pagesvisited": "Pages visited",
+ "bs-pagesvisited-widget-title": "Pages visited",
+ "bs-pagesvisited-error-nsnotvalid": "Given namespace{{PLURAL:$1||s}}
<code>$2</code> {{PLURAL:$1|is|are}} not valid.",
+ "bs-pagesvisited-pref-widgetlimit": "Limit of entries:",
+ "bs-pagesvisited-pref-widgetns": "Namespaces:",
+ "bs-pagesvisited-pref-widgetsortodr": "Sort by:",
+ "bs-pagesvisited-pref-sort-time": "Time",
+ "bs-pagesvisited-pref-sort-pagename": "Title",
+ "bs-pagesvisited-tag-pagesvisited-desc": "Show a list of pages you have
visited."
+}
diff --git a/PagesVisited/i18n/qqq.json b/PagesVisited/i18n/qqq.json
new file mode 100644
index 0000000..0bb01dd
--- /dev/null
+++ b/PagesVisited/i18n/qqq.json
@@ -0,0 +1,17 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-pagesvisited-desc": "Used in
[[Special:Wiki_Admin&mode=ExtensionInfo]], description of pages visited
extension",
+ "prefs-pagesvisited": "Used in [[Special:Wiki_Admin&mode=Preferences]],
headline for pages visited section in preferences.\n{{Identical|Pages
visited}}",
+ "bs-pagesvisited-widget-title": "Widget headline for pages visited\n
{{Identical|Pages visited}}",
+ "bs-pagesvisited-error-nsnotvalid": "Text for given
namespace{{PLURAL:$1||s}} <code>$2</code> {{PLURAL:$1|is|are}} not valid. \n $1
is the number of namespaces for PLURAL distinction \n $2 the namespace or comma
seperated list of namespaces",
+ "bs-pagesvisited-pref-widgetlimit": "Option in
[[Special:Wiki_Admin&mode=Preferences]], label for limit of entries:",
+ "bs-pagesvisited-pref-widgetns": "Option in
[[Special:Wiki_Admin&mode=Preferences]], label for namespaces:",
+ "bs-pagesvisited-pref-widgetsortodr": "Option in
[[Special:Wiki_Admin&mode=Preferences]], label for sort by:",
+ "bs-pagesvisited-pref-sort-time": "Option in
[[Special:Wiki_Admin&mode=Preferences]], option label for time",
+ "bs-pagesvisited-pref-sort-pagename": "Option in
[[Special:Wiki_Admin&mode=Preferences]], option label for title",
+ "bs-pagesvisited-tag-pagesvisited-desc": "Used in InsertMagic
extension, tag description for show a list of pages you have visited."
+}
diff --git a/PagesVisited/languages/PagesVisited.i18n.php
b/PagesVisited/languages/PagesVisited.i18n.php
index b14c366..7e8d868 100644
--- a/PagesVisited/languages/PagesVisited.i18n.php
+++ b/PagesVisited/languages/PagesVisited.i18n.php
@@ -1,62 +1,35 @@
<?php
/**
- * Internationalisation file for PagesVisited
+ * 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 PagesVisited
- * @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( 'wfJsonI18nShim9a1115f5905760e5' ) ) {
+ function wfJsonI18nShim9a1115f5905760e5( $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-pagesvisited-extension-description' => 'Provides a
personalized list of last visited pages.',
- 'prefs-PagesVisited' => 'Visited pages',
- 'pagesvisited' => 'Visited pages',
- 'bs-pagesvisited-widget-title' => 'Visited pages',
- 'bs-pagesvisited-integer-range-validation-too-low' => 'Provided value
is to low',
- 'bs-pagesvisited-integer-range-validation-too-high' => 'Provided value
is to heigh',
- 'bs-pagesvisited-error-namespace-not-valid' => 'Given namespace
"$1" is not valid.',
- 'bs-pagesvisited-error-namespaces-not-valid' => 'Given
namespaces "$1" are not valid.',
- 'bs-pagesvisited-PagesVisited' => 'Visited pages',
- 'bs-pagesvisited-pref-WidgetLocation' => 'Place to
display [Focus|Widget]',
- 'bs-pagesvisited-pref-WidgetLimit' => 'Limit of
entries',
- 'bs-pagesvisited-pref-WidgetNS' => 'Namespaces',
- 'bs-pagesvisited-pref-WidgetSortOdr' => 'Sort by',
- 'bs-pagesvisited-pref-sort-time' => 'Time',
- 'bs-pagesvisited-pref-sort-pagename' => 'Title',
- 'bs-pagesvisited-pref-namespaces-all' => 'All',
- 'bs-pagesvisited-tag-pagesvisited-desc' => 'Show a list of
articles you have visited'
-);
+ $cachedData['deps'][] = new FileDependency( $fileName );
+ }
+ return true;
+ }
-$messages['de'] = array(
- 'bs-pagesvisited-extension-description' => 'Stellt eine
personalisierte Liste der zuletzt besuchten Artikel zur Verfügung.',
- 'prefs-PagesVisited' => 'Besuchte
Seiten',
- 'pagesvisited' => 'Besuchte
Seiten',
- 'bs-pagesvisited-PagesVisited' => 'Besuchte
Seiten',
- 'bs-pagesvisited-widget-title' => 'Besuchte
Seiten',
- 'bs-pagesvisited-integer-range-validation-too-low' => 'Der angegebene
Wert ist zu niedrig',
- 'bs-pagesvisited-integer-range-validation-too-high' => 'Der angegebene
Wert ist zu hoch',
- 'bs-pagesvisited-error-namespace-not-valid' => 'Der angegebene
Namensraum "$1" ist nicht gültig.',
- 'bs-pagesvisited-error-namespaces-not-valid' => 'Die angegebenen
Namensräume "$1" sind nicht gültig.',
- 'bs-pagesvisited-pref-WidgetLocation' => 'Anzeigeort
[Focus|Widget]',
- 'bs-pagesvisited-pref-WidgetLimit' => 'Anzahl der
Einträge',
- 'bs-pagesvisited-pref-WidgetNS' => 'Anzuzeigende
Namensräume',
- 'bs-pagesvisited-pref-WidgetSortOdr' => 'Sortieren nach',
- 'bs-pagesvisited-pref-sort-time' => 'Zeit',
- 'bs-pagesvisited-pref-sort-pagename' => 'Titel',
- 'bs-pagesvisited-pref-namespaces-all' => 'Alle',
- 'bs-pagesvisited-tag-pagesvisited-desc' => 'Gibt eine Liste
mit Aritkeln aus, die du besucht hast'
-);
-
-$messages['de-formal'] = array(
- 'bs-pagesvisited-tag-pagesvisited-desc' => 'Gibt eine Liste
mit Aritkeln aus, die Sie besucht haben'
-);
-
-$messages['qqq'] = array();
\ No newline at end of file
+ $GLOBALS['wgHooks']['LocalisationCacheRecache'][] =
'wfJsonI18nShim9a1115f5905760e5';
+}
--
To view, visit https://gerrit.wikimedia.org/r/139823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8231d4a73ac299392b3975634fe2a54d300831b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits