Tamslo has uploaded a new change for review.

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

Change subject: Changed format of long message on item page
......................................................................

Changed format of long message on item page

Change-Id: I56ba0a6c0bc5b5e36f6c1fa17836806e98ee74f4
---
M i18n/en.json
M i18n/qqq.json
M includes/Violations/CrossCheckViolationFormatter.php
M tests/phpunit/Violations/CrossCheckViolationFormatterTest.php
4 files changed, 11 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataQualityExternalValidation
 refs/changes/21/217821/1

diff --git a/i18n/en.json b/i18n/en.json
index 0d8b697..960e878 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -51,9 +51,9 @@
   "wbqev-violation-header-external-source": "External source:",
   "wbqev-violation-header-local-value": "Wikidata value:",
   "wbqev-violation-header-external-values": "External values:",
-  "wbqev-violation-short-message": "This value does not match with a value in 
$1. Please click on icon for further information.",
-  "wbqev-violation-long-message-headline": "$1",
-  "wbqev-violation-long-message-external-values": "The 
{{PLURAL:$2|value|values}} stated in the external source {{PLURAL:$2|is|are}} 
$1.",
+  "wbqev-violation-short-message": "This value does not match with a value in 
$1.",
+  "wbqev-violation-long-message-headline": "Mismatch with external database",
+  "wbqev-violation-long-message-external-values": "The 
{{PLURAL:$2|value|values}} stated in $3 {{PLURAL:$2|is|are}} $1.",
   "wbqev-violation-long-message-solve-issue": "In order to solve this issue, 
please check carefully which value is right and add a reference.",
   "wbqev-violation-mark-as-exception": "Mark as exception"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d2196a6..c4fa3e6 100755
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -50,7 +50,7 @@
        "wbqev-violation-header-external-values": "Header for section in 
violations special page that displays the name of the external source.",
        "wbqev-violation-short-message": "Short message that is shown for 
violated claims in pop-up on item page. First parameter is name of the data 
source.",
        "wbqev-violation-long-message-headline": "Header for long message that 
is shown for violated claims on item page.",
-       "wbqev-violation-long-message-external-values": "Long message that is 
shown for violated claims on item page. First parameter are the external 
values, second parameter is the number of external values.",
+       "wbqev-violation-long-message-external-values": "Long message that is 
shown for violated claims on item page. First parameter are the external 
values, second parameter is the number of external values, third parameter the 
name of the external source.",
        "wbqev-violation-long-message-solve-issue": "Message that is shown for 
violated claims in order to advise the user how to solve the issue.",
     "wbqev-violations-mark-as-exception": "Message that is shown for marking a 
violation as exception on item page."
 }
diff --git a/includes/Violations/CrossCheckViolationFormatter.php 
b/includes/Violations/CrossCheckViolationFormatter.php
index 84228d3..b4c330b 100755
--- a/includes/Violations/CrossCheckViolationFormatter.php
+++ b/includes/Violations/CrossCheckViolationFormatter.php
@@ -220,15 +220,13 @@
 
         $message =
             '<span class="wbq-long-message-headline">'
-            . wfMessage( 'wbqev-violation-long-message-headline' )
-                ->params( $dataSource )
-                ->text()
+            . wfMessage( 'wbqev-violation-long-message-headline' )->escaped()
             . '</span>';
         if( $externalValues ) {
             $message .= Html::element( 'br' );
             $message .= wfMessage( 
'wbqev-violation-long-message-external-values' )
-                ->params( implode( ', ', $externalValues ), sizeof( 
$additionalInfo['external_values'] ) )
-                ->escaped();
+                ->params( implode( ', ', $externalValues ), sizeof( 
$additionalInfo['external_values']), $dataSource )
+                ->text();
         }
         $message .= Html::element( 'br' );
 
diff --git a/tests/phpunit/Violations/CrossCheckViolationFormatterTest.php 
b/tests/phpunit/Violations/CrossCheckViolationFormatterTest.php
index 59b66ab..7c7d843 100755
--- a/tests/phpunit/Violations/CrossCheckViolationFormatterTest.php
+++ b/tests/phpunit/Violations/CrossCheckViolationFormatterTest.php
@@ -251,7 +251,7 @@
     public function getLongMessageDataProvider() {
         return array(
             array(
-                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline: 
Q84)</span><br />(wbqev-violation-long-message-external-values: bar, 1)<br 
/>(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
+                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline)</span><br
 />(wbqev-violation-long-message-external-values: bar, 1, Q84)<br 
/>(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
                 true,
                 $this->getViolationMock(
                     new ItemId( 'Q1' ),
@@ -262,7 +262,7 @@
                 )
             ),
             array(
-                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline: 
Q84)</span><br />(wbqev-violation-long-message-external-values: foo, bar, 2)<br 
/>(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
+                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline)</span><br
 />(wbqev-violation-long-message-external-values: foo, bar, 2, Q84)<br 
/>(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
                 true,
                 $this->getViolationMock(
                     new ItemId( 'Q1' ),
@@ -273,7 +273,7 @@
                 )
             ),
             array(
-                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline: 
Q84)</span><br />(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
+                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline)</span><br
 />(wbqev-violation-long-message-solve-issue)<br /><div 
class="wbq-container-mark-as-exception"><a href="" 
class="wbq-mark-as-exception">(wbqev-violation-mark-as-exception)</a></div>',
                 true,
                 $this->getViolationMock(
                     new ItemId( 'Q1' ),
@@ -295,7 +295,7 @@
                 'InvalidArgumentException'
             ),
             array(
-                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline: 
Q84)</span><br />(wbqev-violation-long-message-solve-issue)<br />',
+                '<span 
class="wbq-long-message-headline">(wbqev-violation-long-message-headline)</span><br
 />(wbqev-violation-long-message-solve-issue)<br />',
                 false,
                 $this->getViolationMock(
                     new ItemId( 'Q1' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56ba0a6c0bc5b5e36f6c1fa17836806e98ee74f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Tamslo <tamaraslosa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to