Kipcool has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/267438 )

Change subject: Fix header message in Special:Ow_data_search
......................................................................


Fix header message in Special:Ow_data_search

Bug: T124769
Change-Id: Ifb9f386870cd01da6540f13dae43f2a7bd6a6182
---
M i18n/lexicaldata/en.json
M i18n/lexicaldata/qqq.json
M includes/specials/SpecialDatasearch.php
3 files changed, 19 insertions(+), 7 deletions(-)

Approvals:
  Kipcool: Verified; Looks good to me, approved
  Nemo bis: Looks good to me, but someone else must approve
  Siebrand: Looks good to me, but someone else must approve



diff --git a/i18n/lexicaldata/en.json b/i18n/lexicaldata/en.json
index cd09249..4071f0d 100644
--- a/i18n/lexicaldata/en.json
+++ b/i18n/lexicaldata/en.json
@@ -35,8 +35,10 @@
        "datasearch_within_ext_ids": "Within external identifiers:",
        "datasearch_showing_only": "Showing only a maximum of $1 
{{PLURAL:$1|match|matches}} (out of $2).",
        "datasearch_match_ext_ids": "External identifiers matching <em>$1</em>",
-       "datasearch_match_words": "Words matching <em>$1</em> and associated 
meanings",
-       "datasearch_match_words_lang": "Words in <em>$1</em> matching 
<em>$2</em> and associated meanings",
+       "datasearch_match_words": "Expressions matching <em>$1</em> and their 
associated meanings",
+       "datasearch_match_words_lang": "Expressions in <em>$1</em> matching 
<em>$2</em> and their associated meanings",
+       "datasearch-match-expr": "Expressions and their associated meanings",
+       "datasearch-match-expr-lang": "Expressions in <em>$1</em> and their 
associated meanings",
        "importtsv": "Import TSV",
        "ow_importtsv_title1": "Import TSV",
        "ow_importtsv_title2": "Import definitions and translations",
diff --git a/i18n/lexicaldata/qqq.json b/i18n/lexicaldata/qqq.json
index eb53a21..1cc77c9 100644
--- a/i18n/lexicaldata/qqq.json
+++ b/i18n/lexicaldata/qqq.json
@@ -50,8 +50,10 @@
        "datasearch_within_ext_ids": "Used on [[Special:Dataeearch]] as label",
        "datasearch_showing_only": "Parameters:\n* $1 - 100 (hard-coded)\n* $2 
- number of results (number of matches), or empty string(?)",
        "datasearch_match_ext_ids": "*'''$1''': searched text",
-       "datasearch_match_words": "*'''$1''': searched text",
-       "datasearch_match_words_lang": "*'''$1''': language name\n*'''$2''': 
searched text",
+       "datasearch_match_words": "A special page title.\n*'''$1''': searched 
text",
+       "datasearch_match_words_lang": "A special page title.\n*'''$1''': 
language name\n*'''$2''': searched text",
+       "datasearch-match-expr": "A special page title.",
+       "datasearch-match-expr-lang": "A special page title.\n*'''$2''': 
searched text",
        "importtsv": "TSV (tab separated value).\n\nSee also:\n* 
{{msg-mw|Exporttsv}}",
        "ow_importtsv_title1": "Used as page title on [[Special:ImportTSV]]",
        "ow_importtsv_title2": "Used as page title on [[Special:ImportTSV]]",
diff --git a/includes/specials/SpecialDatasearch.php 
b/includes/specials/SpecialDatasearch.php
index deba20e..f939633 100644
--- a/includes/specials/SpecialDatasearch.php
+++ b/includes/specials/SpecialDatasearch.php
@@ -140,10 +140,18 @@
        function search() {
                $output = $this->getOutput();
                if ( $this->withinWords ) {
-                       if ( $this->languageId != 0 && $this->languageName != 
"" ) {
-                               $headerText = wfMessage( 
'datasearch_match_words_lang', $this->languageName, $this->searchText )->text();
+                       if ( strlen( $this->searchText ) ) {
+                               if ( $this->languageId != 0 && 
$this->languageName != "" ) {
+                                       $headerText = wfMessage( 
'datasearch_match_words_lang', $this->languageName, $this->searchText )->text();
+                               } else {
+                                       $headerText = wfMessage( 
'datasearch_match_words', $this->searchText )->text();
+                               }
                        } else {
-                               $headerText = wfMessage( 
'datasearch_match_words', $this->searchText )->text();
+                               if ( $this->languageId != 0 && 
$this->languageName != "" ) {
+                                       $headerText = wfMessage( 
'datasearch-match-expr-lang', $this->languageName )->text();
+                               } else {
+                                       $headerText = wfMessage( 
'datasearch-match-expr' )->text();
+                               }
                        }
                        $output->addHTML( Html::rawElement( 'h1', array(), 
$headerText ) );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb9f386870cd01da6540f13dae43f2a7bd6a6182
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Purodha <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Kipcool <[email protected]>
Gerrit-Reviewer: Nemo bis <[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

Reply via email to