jenkins-bot has submitted this change and it was merged.
Change subject: Show "For all languages" when the page is in the source language
......................................................................
Show "For all languages" when the page is in the source language
Change-Id: I675e8bf6160be7eaa058efc92e74ea03cd687f9b
---
M MainPage.i18n.php
M specials/SpecialTwnMainPage.php
2 files changed, 17 insertions(+), 3 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MainPage.i18n.php b/MainPage.i18n.php
index c6322ef..dc5085f 100644
--- a/MainPage.i18n.php
+++ b/MainPage.i18n.php
@@ -10,6 +10,7 @@
/** English
* @author Nike
+ * @author Amire80
*/
$messages['en'] = array(
'twnmp-desc' => 'Provides the translatewiki.net main page',
@@ -35,6 +36,7 @@
'twnmp-proofread-button' => 'Proofread',
'twnmp-your-translations-stats' => 'Your translation statistics',
+ 'twnmp-your-translations-stats-all-languages' => 'For all languages',
'twnmp-your-view-language-stats' => 'View language statistics',
'twnmp-translations-per-month' => 'Translations/month',
'twnmp-reviews-per-month' => 'Reviews/month',
@@ -121,6 +123,7 @@
'twnmp-your-translations-stats' => "A header for the user's translation
statistics.
See example: [[Special:MainPage]]",
+ 'twnmp-your-translations-stats-all-languages' => 'Appears under the
message {{msg-mw|twnmp-your-translations-stats}} when the user language is the
same as the source language for all translations.',
'twnmp-your-view-language-stats' => "A link that appears under the
user's translation statistics.",
'twnmp-translations-per-month' => "Used in [[Special:Mainpage]].
Appears in the user's statistics box near a number.
@@ -645,6 +648,7 @@
'twnmp-translate-button' => 'תרגום',
'twnmp-proofread-button' => 'הגהה',
'twnmp-your-translations-stats' => 'סטטיסטיקת התרגומים שלך',
+ 'twnmp-your-translations-stats-all-languages' => 'בכל השפות',
'twnmp-your-view-language-stats' => 'הצגת הסטטיסטיקה לשפה',
'twnmp-translations-per-month' => 'תרגומים לחודש',
'twnmp-reviews-per-month' => 'הגהות לחודש',
diff --git a/specials/SpecialTwnMainPage.php b/specials/SpecialTwnMainPage.php
index c23e6b0..da1cbe4 100644
--- a/specials/SpecialTwnMainPage.php
+++ b/specials/SpecialTwnMainPage.php
@@ -235,7 +235,6 @@
$image = Html::element( 'div', array( 'class' =>
"project-icon-$id" ) );
$label = htmlspecialchars( $group->getLabel(
$this->getContext() ) );
-
$title = SpecialPage::getTitleFor( 'Translate' );
$translate = Html::element( 'a', array(
'class' => 'translate',
@@ -254,7 +253,7 @@
<div class="project-icon four columns">$image</div>
<div class="project-content eight columns">
<div class="row project-name"
dir="auto">$label</div>
- <div class="row project-statsbar">$stats</div>
+ <div class="row
project-statsbar">$statsHtml</div>
<div class="row project-stats">$acts</div>
</div>
</div>
@@ -562,12 +561,23 @@
);
$out .= Html::openElement( 'div', array( 'class' => 'row
user-stats-title' ) );
+
$out .= Html::element(
'h2',
array(),
$this->msg( 'twnmp-your-translations-stats' )->text()
);
- $out .= Html::element( 'div', array(), $languageName );
+
+ $groupsSourceLanguage =
MessageGroups::haveSingleSourceLanguage( MessageGroups::getAllGroups() );
+ if ( $groupsSourceLanguage === $languageCode ) {
+ $translationStatsSubtitle = $this->msg(
+ 'twnmp-your-translations-stats-all-languages'
+ )->text();
+ } else {
+ $translationStatsSubtitle = $languageName;
+ }
+
+ $out .= Html::element( 'div', array(),
$translationStatsSubtitle );
$out .= Html::closeElement( 'div' );
$myuser = $this->getUser()->getName();
--
To view, visit https://gerrit.wikimedia.org/r/84107
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I675e8bf6160be7eaa058efc92e74ea03cd687f9b
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/TwnMainPage
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits