Siebrand has uploaded a new change for review.

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


Change subject: WIP
......................................................................

WIP

Change-Id: Ie3abb0411922bada6f7040699dbd8e4552eaff78
---
M PageTranslation.i18n.php
M tag/SpecialPageTranslation.php
2 files changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/15/76115/1

diff --git a/PageTranslation.i18n.php b/PageTranslation.i18n.php
index 0d45313..fd4ef9e 100644
--- a/PageTranslation.i18n.php
+++ b/PageTranslation.i18n.php
@@ -43,6 +43,7 @@
 Make sure it has <nowiki><translate></nowiki> tags and has a valid syntax.',
        'tpt-saveok' => 'The page [[$1]] has been marked up for translation 
with $2 {{PLURAL:$2|translation unit|translation units}}.
 The page can now be <span class="plainlinks">[$3 translated]</span>.',
+       'tpt-offer-notify' => 'You can <span class="plainlinks">[$1 notify 
translators]</span> about this page.',
        'tpt-badsect' => '"$1" is not a valid name for translation unit $2.',
        'tpt-showpage-intro' => 'Below new, existing and deleted translation 
units are listed.
 Before marking this version for translation, check that the changes to 
translation units are minimized to avoid unnecessary work for translators.',
diff --git a/tag/SpecialPageTranslation.php b/tag/SpecialPageTranslation.php
index 52eaf35..8428578 100644
--- a/tag/SpecialPageTranslation.php
+++ b/tag/SpecialPageTranslation.php
@@ -168,10 +168,20 @@
        public function showSuccess( TranslatablePage $page ) {
                $titleText = $page->getTitle()->getPrefixedText();
                $num = $this->getLanguage()->formatNum( 
$page->getParse()->countSections() );
+               $messageGroupId = $page->getMessageGroupId();
                $link = SpecialPage::getTitleFor( 'Translate' )->getFullUrl(
-                       array( 'group' => $page->getMessageGroupId() ) );
+                       array( 'group' => $messageGroupId ) );
 
                $this->getOutput()->addWikiMsg( 'tpt-saveok', $titleText, $num, 
$link );
+               // If TranslationNotifications is installed, and the user can 
notify
+               // translators, add a convenience link.
+               if ( method_exists( 'SpecialNotifyTranslators', 'execute' ) &&
+                       $this->getUser()->isAllowed( 
SpecialNotifyTranslators::$right )
+               ) {
+                       $link = SpecialPage::getTitleFor( 'NotifyTranslators' 
)->getFullUrl(
+                               array( 'group' => $messageGroupId ) );
+                       $this->getOutput()->addWikiMsg( 'tpt-offer-notify', 
$link );
+               }
        }
 
        public function loadPagesFromDB() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3abb0411922bada6f7040699dbd8e4552eaff78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>

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

Reply via email to