Smuggli has submitted this change and it was merged.
Change subject: Implemented changes for translatewiki
......................................................................
Implemented changes for translatewiki
Moved to Json i18n files
Imporved qqq message
Fixed typo Not -> No
Change-Id: Ia6b25b16e5b0c2df5b8682ed7a5380aa7a1ff095
---
M CountThings/CountThings.class.php
M CountThings/CountThings.setup.php
A CountThings/i18n/de-formal.json
A CountThings/i18n/de.json
A CountThings/i18n/en.json
A CountThings/i18n/qqq.json
M CountThings/languages/CountThings.i18n.php
M CountThings/views/view.CountCharacters.php
8 files changed, 98 insertions(+), 53 deletions(-)
Approvals:
Smuggli: Verified; Looks good to me, approved
Siebrand: Looks good to me, but someone else must approve
diff --git a/CountThings/CountThings.class.php
b/CountThings/CountThings.class.php
index fff97cd..c9d2214 100644
--- a/CountThings/CountThings.class.php
+++ b/CountThings/CountThings.class.php
@@ -162,7 +162,7 @@
public function onMagicWordBsCountCharacters( $input, $args, $parser ) {
$parser->disableCache();
if ( empty( $input ) ) {
- $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-countchars-no-input' )->plain() );
+ $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-no-input' )->plain() );
return $oErrorView->execute();
}
@@ -174,7 +174,7 @@
$bValidModeProvided = false;
foreach( $aModes as $sMode ) {
if( !in_array( $sMode, $aAvailableModes ) ){
- $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-countchars-invalid-mode', $sMode )->plain() );
+ $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-invalid-mode', $sMode )->plain() );
$sOut .= $oErrorView->execute();
continue;
}
@@ -186,7 +186,7 @@
foreach( $aTitleTexts as $sTitleText ) {
$oTitle = Title::newFromText( trim( $sTitleText ) );
if( $oTitle == null || $oTitle->exists() == false ) {
- $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-countchars-title-does-not-exist', $sTitleText )->plain()
);
+ $oErrorView = new ViewTagError( wfMessage(
'bs-countthings-error-not-exist', $sTitleText )->plain() );
$sOut .= $oErrorView->execute();
continue;
}
diff --git a/CountThings/CountThings.setup.php
b/CountThings/CountThings.setup.php
index c689b97..f303fda 100644
--- a/CountThings/CountThings.setup.php
+++ b/CountThings/CountThings.setup.php
@@ -1,6 +1,8 @@
<?php
-BsExtensionManager::registerExtension('CountThings',
BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE);
+BsExtensionManager::registerExtension('CountThings',
BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE);
+
+$wgMessagesDirs['CountThings'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['CountThings'] = __DIR__ .
'/languages/CountThings.i18n.php';
diff --git a/CountThings/i18n/de-formal.json b/CountThings/i18n/de-formal.json
new file mode 100644
index 0000000..c5a7b02
--- /dev/null
+++ b/CountThings/i18n/de-formal.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-countthings-error-invalid-mode": "Der Konfigurationsparameter
\"$1\" ist nicht zulässig. Bitte verwenden Sie \"chars\", \"words\", oder
\"pages\"."
+}
diff --git a/CountThings/i18n/de.json b/CountThings/i18n/de.json
new file mode 100644
index 0000000..f2e4212
--- /dev/null
+++ b/CountThings/i18n/de.json
@@ -0,0 +1,18 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-countthings-desc": "Stellt Inhaltsbasierte Statistiken bereit",
+ "bs-countthings-chars-label": "Zeichen",
+ "bs-countthings-words-label": "Wörter",
+ "bs-countthings-pages-label": "Seiten",
+ "bs-countthings-error-no-input": "Es wurden keine Seite angegeben.",
+ "bs-countthings-error-invalid-mode": "Der Konfigurationsparameter
\"$1\" ist nicht zulässig. Bitte verwende \"chars\", \"words\", oder
\"pages\".",
+ "bs-countthings-error-not-exist": "Der Seite \"$1\" existiert nicht.",
+ "bs-countthings-tag-countarticles-desc": "Gibt die Anzahl der Seiten
aus.",
+ "bs-countthings-tag-countusers-desc": "Gibt die Anzahl der Benutzer
aus.",
+ "bs-countthings-tag-countcharacters-desc": "Stellt eine Statistik des
Inhalts der angegeben Seiten dar. Verfügbarer Konfigurationsparameter ist:",
+ "bs-countthings-tag-countcharacters-desc-param-mode":
"<code>mode</code>: Was soll gezählt werden <code>chars</code> (Zeichen),
<code>words</code> (Wörter) oder <code>pages</code> (Seiten)."
+}
diff --git a/CountThings/i18n/en.json b/CountThings/i18n/en.json
new file mode 100644
index 0000000..6c0d2c0
--- /dev/null
+++ b/CountThings/i18n/en.json
@@ -0,0 +1,18 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-countthings-desc": "Provides content based statistics",
+ "bs-countthings-chars-label": "Characters",
+ "bs-countthings-words-label": "Words",
+ "bs-countthings-pages-label": "Pages",
+ "bs-countthings-error-no-input": "No page provided.",
+ "bs-countthings-error-invalid-mode": "The mode \"$1\" is invalid.
Please use \"chars\", \"words\", or \"pages\".",
+ "bs-countthings-error-not-exist": "The page \"$1\" does not exist.",
+ "bs-countthings-tag-countarticles-desc": "Displays the number of
pages.",
+ "bs-countthings-tag-countusers-desc": "Displays the number of users.",
+ "bs-countthings-tag-countcharacters-desc": "Displays statistics of the
given page content. Available configuration attribute:",
+ "bs-countthings-tag-countcharacters-desc-param-mode":
"<code>mode</code>: What should be counted <code>chars</code> (characters),
<code>words</code> (words) or <code>pages</code> (pages)."
+}
diff --git a/CountThings/i18n/qqq.json b/CountThings/i18n/qqq.json
new file mode 100644
index 0000000..cfc9fc6
--- /dev/null
+++ b/CountThings/i18n/qqq.json
@@ -0,0 +1,18 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stephan Muggli <[email protected]>"
+ ]
+ },
+ "bs-countthings-desc": "Used in
[{{canonicalurl:Special:WikiAdmin|mode=ExtensionInfo}}
Special:WikiAdmin?mode=ExtensionInfo], description of count things extension",
+ "bs-countthings-chars-label": "Table headline for
characters\n{{Identical|Characters}}",
+ "bs-countthings-words-label": "Table headline for
words\n{{Identical|Words}}",
+ "bs-countthings-pages-label": "Table headline for
pages\n{{Identical|Pages}}",
+ "bs-countthings-error-no-input": "Error message that no page was
provided.",
+ "bs-countthings-error-invalid-mode": "Error message that the given mode
is invalid. Valid modes are <code>chars</code>, <code>words</code>, or
<code>pages</code>.\n*{{doc-important|Do not translate
<code>chars</code>}}\n*{{doc-important|Do not translate
<code>words</code>}}\n*{{doc-important|Do not translate
<code>pages</code>}}\n*$1 is the given mode which is invalid.",
+ "bs-countthings-error-not-exist": "Error message that the given page
does not exist.\n*$1 is the page which does not exist.",
+ "bs-countthings-tag-countarticles-desc": "Used in InsertMagic
extension, tag description for displays the number of pages.",
+ "bs-countthings-tag-countusers-desc": "Used in InsertMagic extension,
tag description for displays the number of users.",
+ "bs-countthings-tag-countcharacters-desc": "Used in InsertMagic
extension, tag description for displays statistics of the given page content.
Available configuration attribute:",
+ "bs-countthings-tag-countcharacters-desc-param-mode": "Text for
<code>mode</code>: What of the given page content should be counted
<code>chars</code> (characters), <code>words</code> (words) or
<code>pages</code> (pages)."
+}
diff --git a/CountThings/languages/CountThings.i18n.php
b/CountThings/languages/CountThings.i18n.php
index 804911b..365c0a0 100644
--- a/CountThings/languages/CountThings.i18n.php
+++ b/CountThings/languages/CountThings.i18n.php
@@ -1,54 +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( 'wfJsonI18nShim4ff042579690ccec' ) ) {
+ function wfJsonI18nShim4ff042579690ccec( $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-countthings-extension-description' => 'Zählt alle
möglichen Dinge.',
- 'CountThings' => 'CountThings',
- 'bs-countthings-countchars-chars-label' => 'Zeichen',
- 'bs-countthings-countchars-words-label' => 'Wörter',
- 'bs-countthings-countchars-pages-label' => 'Seiten',
- 'bs-countthings-error-countchars-no-input' => 'Es wurden
keine Titel angegeben.',
- 'bs-countthings-error-countchars-invalid-mode' => 'Der
angegebene Modus "$1" ist nicht zulässig. Bitte verwende "chars", "words", oder
"pages".',
- 'bs-countthings-error-countchars-title-does-not-exist' => 'Der
angegebene Titel "$1" existiert nicht.',
- 'bs-countthings-tag-countarticles-desc' => "Gibt die
Anzahl der Artikel im Wiki aus.",
- 'bs-countthings-tag-countusers-desc' => "Gibt die
Anzahl der Benutzer im Wiki aus.",
- 'bs-countthings-tag-countcharacters-desc' => "Stellt eine
Statistik des Inhalts der übergebenen Artikel dar.
-Verfügbare Parameter:
-;mode: Mögliche Werte sind <code>chars</code>, <code>words</code>,
<code>pages</code>, <code>all</code>, ",
-);
+ $cachedData['deps'][] = new FileDependency( $fileName );
+ }
+ return true;
+ }
-$messages['de-formal'] = array(
- 'bs-countthings-error-countchars-invalid-mode' => 'Der
angegebene Modus "$1" ist nicht zulässig. Bitte verwenden Sie "chars", "words",
oder "pages".',
-);
-
-$messages['en'] = array(
- 'bs-countthings-extension-description' => 'Counts all
kinds of things.',
- 'CountThings' => 'CountThings',
- 'bs-countthings-countchars-chars-label' => 'Characters',
- 'bs-countthings-countchars-words-label' => 'Words',
- 'bs-countthings-countchars-pages-label' => 'Pages',
- 'bs-countthings-error-countchars-no-input' => 'Not title
provided.',
- 'bs-countthings-error-countchars-invalid-mode' => 'The provided
mode "$1" is invalid. Please use "chars", "words", or "pages".',
- 'bs-countthings-error-countchars-title-does-not-exist' => 'The provided
title "$1" does not exist.',
- 'bs-countthings-tag-countarticles-desc' => "Returns the
number of articles in the wiki",
- 'bs-countthings-tag-countusers-desc' => "Returns the
number of users in the wiki",
- 'bs-countthings-tag-countcharacters-desc' => "Renders a
statistic box of the given articles content.
-Valid attributes:
-;mode: Possible values are <code>chars</code>, <code>words</code>,
<code>pages</code>, <code>all</code>, ",
-);
-
-$messages['qqq'] = array();
\ No newline at end of file
+ $GLOBALS['wgHooks']['LocalisationCacheRecache'][] =
'wfJsonI18nShim4ff042579690ccec';
+}
diff --git a/CountThings/views/view.CountCharacters.php
b/CountThings/views/view.CountCharacters.php
index ff448b3..981a7dc 100644
--- a/CountThings/views/view.CountCharacters.php
+++ b/CountThings/views/view.CountCharacters.php
@@ -53,11 +53,11 @@
$aOut[] = ' <table class="wikitable">';
$aOut[] = ' <tr><th colspan="2">'.$wgUser->getSkin()->link(
$this->oTitle ).'</th></tr>';
if( $this->iChars != -1 )
- $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-countchars-chars-label'
)->plain().'</th><td>'.$this->iChars.'</td></tr>';
+ $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-chars-label' )->plain().'</th><td>'.$this->iChars.'</td></tr>';
if( $this->iWords != -1 )
- $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-countchars-words-label'
)->plain().'</th><td>'.$this->iWords.'</td></tr>';
+ $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-words-label' )->plain().'</th><td>'.$this->iWords.'</td></tr>';
if( $this->iPages != -1 )
- $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-countchars-pages-label'
)->plain().'</th><td>'.$this->iPages.'</td></tr>';
+ $aOut[] = ' <tr><th>'.wfMessage(
'bs-countthings-pages-label' )->plain().'</th><td>'.$this->iPages.'</td></tr>';
$aOut[] = ' </table>';
$aOut[] = '</div>';
--
To view, visit https://gerrit.wikimedia.org/r/149272
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6b25b16e5b0c2df5b8682ed7a5380aa7a1ff095
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