Purodha has uploaded a new change for review.

  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, 18 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData 
refs/changes/38/267438/1

diff --git a/i18n/lexicaldata/en.json b/i18n/lexicaldata/en.json
index 4f9ce90..2107840 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 c8cf22e..9c2b9e8 100644
--- a/i18n/lexicaldata/qqq.json
+++ b/i18n/lexicaldata/qqq.json
@@ -39,8 +39,10 @@
        "datasearch_meaning": "{{Identical|Meaning}}",
        "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_header": "'test run' comes from {{msg-mw|ow importtsv 
test run}}.",
        "ow_importtsv_bad_columns": "Unused (commented out) at this time.\n\nDo 
not translate 'definition_iso' and 'translations_iso'.\n\nParameters:\n* $1 - 
column name",
diff --git a/includes/specials/SpecialDatasearch.php 
b/includes/specials/SpecialDatasearch.php
index 37ea4d0..ccd3f05 100644
--- a/includes/specials/SpecialDatasearch.php
+++ b/includes/specials/SpecialDatasearch.php
@@ -140,10 +140,17 @@
        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: newchange
Gerrit-Change-Id: Ifb9f386870cd01da6540f13dae43f2a7bd6a6182
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Purodha <puro...@blissenbach.org>

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

Reply via email to