MarkTraceur has uploaded a new change for review.

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

Change subject: Fix the link to the file page
......................................................................

Fix the link to the file page

A little hacky, maybe, but this seems like the "best" option.

Bug: T140500
Change-Id: I878b0fd691670da7a96b6a8e8bd02f1659eb4d1e
---
M i18n/en.json
M i18n/qqq.json
M includes/FileAnnotationsContent.php
3 files changed, 15 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileAnnotations 
refs/changes/97/299197/1

diff --git a/i18n/en.json b/i18n/en.json
index 13a0153..65e07e0 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -8,5 +8,6 @@
        "save-fileannotation": "Save",
        "cancel-fileannotation": "Cancel",
        "edit-fileannotation": "Edit",
-       "delete-fileannotation": "Delete"
+       "delete-fileannotation": "Delete",
+       "fileannotations-go-to-filepage": "It is recommended that you view and 
edit file annotations on [[:$1|the file page]], where they are available in a 
visual format."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c8cfe97..14670e4 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -8,5 +8,6 @@
        "save-fileannotation": "Text of a button to save a new or edited 
annotation.",
        "cancel-fileannotation": "Text of a button that cancels creating or 
editing an annotation.",
        "edit-fileannotation": "Text of a button to begin editing an 
annotation.",
-       "delete-fileannotation": "Text of a button to delete an annotation."
+       "delete-fileannotation": "Text of a button to delete an annotation.",
+       "fileannotations-go-to-filepage": "Appears on the file annotations page 
to encourage users to go to the file page to interact with the content. $1 is 
the file page title, including namespace, suitable for inclusion in a wikilink. 
The message will be parsed. Remember to put a colon (:) in front of the file 
page title, or the message will put the whole image into the page."
 }
diff --git a/includes/FileAnnotationsContent.php 
b/includes/FileAnnotationsContent.php
index 76b3994..be8a52f 100644
--- a/includes/FileAnnotationsContent.php
+++ b/includes/FileAnnotationsContent.php
@@ -61,12 +61,19 @@
                parent::fillParserOutput( $title, $revId, $options, 
$generateHtml, $output );
 
                if ( $generateHtml && $this->isValid() ) {
+                       $fileTitle = Title::makeTitle(
+                               NS_FILE,
+                               $title->getDBkey()
+                       );
+
+                       $fileMsg = new Message(
+                               'fileannotations-go-to-filepage',
+                               [ $fileTitle->getPrefixedDBkey() ]
+                       );
+
                        $output->setText(
-                               // TODO message-ify
                                '<p>' .
-                                       'It is recommended that you view and 
edit these annotations on ' .
-                                       '<a href="">the file page</a>' .
-                                       ', where they are available in a visual 
format.' .
+                                       $fileMsg->parse() .
                                '</p>' .
                                $output->getText()
                        );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I878b0fd691670da7a96b6a8e8bd02f1659eb4d1e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FileAnnotations
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>

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

Reply via email to