From b1376413f0f95eb46ae3dac67cdba1696715f0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 25 Apr 2020 20:07:00 +0200 Subject: [PATCH] Revise error messages when replying to comments affected by templates Bug: T248607 Change-Id: Iea49d16bb0e5c71b36a79248f3f91f7987e65702 --- i18n/en.json | 4 ++-- i18n/qqq.json | 2 +- modules/controller.js | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 90e91b4fd..29055e80a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -21,8 +21,8 @@ "discussiontools-replywidget-terms-click": "By clicking \"$1\", you agree to the terms of use for this wiki.", "discussiontools-replywidget-transcluded": "Your comment will be saved at [[$1]].", "discussiontools-error-comment-disappeared": "Could not find the comment you're replying to on the page. It might have been deleted or moved to another page. Please reload the page and try again.", - "discussiontools-error-comment-is-transcluded": "This comment can't be replied to using this tool. Please try using the full page editor instead.", - "discussiontools-error-comment-is-transcluded-title": "This comment can't be replied to here (yet), because it is loaded from another page. Please go to [[$1]] to reply to it.", + "discussiontools-error-comment-is-transcluded": "The \"{{int:discussiontools-replylink}}\" link cannot be used to reply to this comment. To reply, please use the full page editor by clicking \"$1\".", + "discussiontools-error-comment-is-transcluded-title": "The \"{{int:discussiontools-replylink}}\" link cannot be used to reply to this comment because it is loaded from another page. To reply, please go here: [[$1]].", "discussiontools-error-lint": "Comments on this page can't be replied to because of an error in the wikitext. You can learn about this error by [$1 reading the documentation], ask for help by [$2 posting here] or fix the error by [$3 opening the full page editor].", "tag-discussiontools": "-", "tag-discussiontools-description": "Edit made using DiscussionTools", diff --git a/i18n/qqq.json b/i18n/qqq.json index 3e9a8d1e1..053502dc7 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -27,7 +27,7 @@ "discussiontools-replywidget-transcluded": "Message explaining that the comment will be saved on a different page than the one you're viewing right now (because it was transcluded from it). Parameter: $1 – page name", "discussiontools-error-lint": "Error message. Parameters:\n* $1 – URL to documentation on mediawiki.org\n* $2 – URL to talk page on mediawiki.org\n* $3 – URL to the editor (action=edit)", "discussiontools-error-comment-disappeared": "Error message.", - "discussiontools-error-comment-is-transcluded": "Error message.", + "discussiontools-error-comment-is-transcluded": "Error message. Parameter: $1 – text of the 'Edit'/'Edit source' tab", "discussiontools-error-comment-is-transcluded-title": "Error message. Parameter: $1 – page name", "tag-discussiontools": "{{ignored}}Short description of the discussiontools tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each edit made using DiscussionTools.\n\nSee also:\n* {{msg-mw|Tag-discussiontools-description}}", "tag-discussiontools-description": "Long description of the discussiontools tag ({{msg-mw|Tag-discussiontools}}).\n\nShown on [[Special:Tags]].\n\nSee also:\n* {{msg-mw|Tag-discussiontools}}", diff --git a/modules/controller.js b/modules/controller.js index 8d8b52f4a..185d1abee 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -418,10 +418,16 @@ function getParsoidCommentData( pageName, oldId, commentId ) { follow = mwTitle && mwTitle.getNamespaceId() !== mw.config.get( 'wgNamespaceIds' ).template; if ( follow ) { - transcludedErrMsg = mw.message( 'discussiontools-error-comment-is-transcluded-title', - mwTitle.getPrefixedText() ).parse(); + transcludedErrMsg = mw.message( + 'discussiontools-error-comment-is-transcluded-title', + mwTitle.getPrefixedText() + ).parse(); } else { - transcludedErrMsg = mw.message( 'discussiontools-error-comment-is-transcluded' ).parse(); + transcludedErrMsg = mw.message( + 'discussiontools-error-comment-is-transcluded', + // eslint-disable-next-line no-jquery/no-global-selector + $( '#ca-edit' ).text() + ).parse(); } return $.Deferred().reject( 'comment-is-transcluded', { errors: [ {