Make show/hide link in RC individually localizable
authorDouglas Gardner <douglas@chippy.ch>
Fri, 24 Jan 2014 13:25:19 +0000 (13:25 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 27 Feb 2014 12:42:25 +0000 (13:42 +0100)
This commit concerns the filters on the [[Special:RecentChanges]] box.
Previously, "Show" and "Hide" in messages such as "Show anonymous users" were a
shared system message: now each filter can be assigned a verb individually.

For example:
* Argument $1 of `rcshowhideminor` used to come from `show` or `hide`.
* $1 now comes from `rcshowhideminor-show` or `rcshowhideminor-hide`.

In place of `show` and `hide`, the following system messages are affected:
* `rcshowhideminor` uses `rcshowhideminor-show` and `rcshowhideminor-hide`.
* `rcshowhidebots` uses `rcshowhidebots-show` and `rcshowhidebots-hide`.
* `rcshowhideanons` uses `rcshowhideanons-show` and `rcshowhideanons-hide`.
* `rcshowhidepatr` uses `rcshowhidepatr-show` and `rcshowhideanons-hide`.
* `rcshowhidemine` uses `rcshowhidemine-show` and `rcshowhidemine-hide`.

This change attempts to correct an issue encountered when localising into
Chechen (ce); previous behaviour made it impossible to translate the entire
sentence fragment correctly (as the verb is rendered slightly differently
depending on the rest of the sentence, and this was not possible with a shared
Show/Hide message).

Bug: 58449
Change-Id: Ibbfc3cd0477b029c8f22a3c812a891ac2109d660

includes/specials/SpecialRecentchanges.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 90abe1c..7083f68 100644 (file)
@@ -936,7 +936,6 @@ class SpecialRecentChanges extends SpecialPage {
                $dl = $lang->pipeList( $dl );
 
                // show/hide links
-               $showhide = array( $this->msg( 'show' )->text(), $this->msg( 'hide' )->text() );
                $filters = array(
                        'hideminor' => 'rcshowhideminor',
                        'hidebots' => 'rcshowhidebots',
@@ -944,7 +943,16 @@ class SpecialRecentChanges extends SpecialPage {
                        'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
                        'hidemyself' => 'rcshowhidemine'
-               );
+                 );
+
+               // The following messages are also used as the link text itself:
+               // rcshowhideminor-show, rcshowhideminor-hide,
+               // rcshowhidebots-show, rcshowhideminor-hide,
+               // rcshowhideanons-show, rcshowhideanons-hide,
+               // rcshowhidepatr-show, rcshowhidepatr-hide,
+               // rcshowhidemine-show, rcshowhidemine-hide.
+               $showhide = array( 'show', 'hide' );
+
                foreach ( $this->getCustomFilters() as $key => $params ) {
                        $filters[$key] = $params['msg'];
                }
@@ -955,7 +963,7 @@ class SpecialRecentChanges extends SpecialPage {
 
                $links = array();
                foreach ( $filters as $key => $msg ) {
-                       $link = $this->makeOptionsLink( $showhide[1 - $options[$key]],
+                       $link = $this->makeOptionsLink( $this->msg( $msg . '-' . $showhide[1 - $options[$key]] ),
                                array( $key => 1 - $options[$key] ), $nondefaults );
                        $links[] = $this->msg( $msg )->rawParams( $link )->escaped();
                }
index 726b8f0..c1f1333 100644 (file)
@@ -2199,11 +2199,23 @@ Your email address is not revealed when other users contact you.',
 'rcnotefrom'                        => "Below are the changes since '''$2''' (up to '''$1''' shown).",
 'rclistfrom'                        => 'Show new changes starting from $1',
 'rcshowhideminor'                   => '$1 minor edits',
+'rcshowhideminor-show'              => 'Show',
+'rcshowhideminor-hide'              => 'Hide',
 'rcshowhidebots'                    => '$1 bots',
+'rcshowhidebots-show'               => 'Show',
+'rcshowhidebots-hide'               => 'Hide',
 'rcshowhideliu'                     => '$1 registered users',
+'rcshowhideliu-show'                => 'Show',
+'rcshowhideliu-hide'                => 'Hide',
 'rcshowhideanons'                   => '$1 anonymous users',
+'rcshowhideanons-show'              => 'Show',
+'rcshowhideanons-hide'              => 'Hide',
 'rcshowhidepatr'                    => '$1 patrolled edits',
+'rcshowhidepatr-show'               => 'Show',
+'rcshowhidepatr-hide'               => 'Hide',
 'rcshowhidemine'                    => '$1 my edits',
+'rcshowhidemine-show'               => 'Show',
+'rcshowhidemine-hide'               => 'Hide',
 'rclinks'                           => 'Show last $1 changes in last $2 days<br />$3',
 'diff'                              => 'diff',
 'hist'                              => 'hist',
index 5ab76d2..a50f75f 100644 (file)
@@ -3630,21 +3630,93 @@ Parameters:
 
 The corresponding message is {{msg-mw|Rcnotefrom}}.',
 'rcshowhideminor' => 'Option text in [[Special:RecentChanges]]. Parameters:
-* $1 - the "show/hide" command, with the text taken from either {{msg-mw|Show}} or {{msg-mw|Hide}}',
+* $1 - the "show/hide" command, with the text taken from either {{msg-mw|rcshowhideminor-show}} or {{msg-mw|rcshowhideminor-hide}}',
+'rcshowhideminor-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideminor}}.
+
+See also:
+* {{msg-mw|rcshowhideminor-hide}}
+{{Identical|Show}}',
+'rcshowhideminor-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideminor}}.
+
+See also:
+* {{msg-mw|rcshowhideminor-show}}
+{{Identical|Hide}}',
 'rcshowhidebots' => 'Option text in [[Special:RecentChanges]]. Parameters:
-* $1 - the "show/hide" command, with the text taken from either {{msg-mw|Show}} or {{msg-mw|Hide}}
+* $1 - the "show/hide" command, with the text taken from either {{msg-mw|rcshowhidebots-show}} or {{msg-mw|rcshowhidebots-hide}}
 {{Identical|$1 bots}}',
+'rcshowhidebots-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidebots}}.
+
+See also:
+* {{msg-mw|rcshowhidebots-show}}
+{{Identical|Show}}',
+'rcshowhidebots-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidebots}}.
+
+See also:
+* {{msg-mw|rcshowhidebots-hide}}
+{{Identical|Hide}}',
 'rcshowhideliu' => 'Option text in [[Special:RecentChanges]]. Parameters:
 * $1 - any one of the following messages:
-** {{msg-mw|Show}}
-** {{msg-mw|Hide}}',
+** {{msg-mw|rcshowhideliu-show}}
+** {{msg-mw|rcshowhideliu-hide}}',
+'rcshowhideliu-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideliu}}.
+
+See also:
+* {{msg-mw|rcshowhideliu-hide}}
+{{Identical|Show}}',
+'rcshowhideliu-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideliu}}.
+
+See also:
+* {{msg-mw|rcshowhideliu-show}}
+{{Identical|Hide}}',
 'rcshowhideanons' => 'Option text in [[Special:RecentChanges]]. Parameters:
-* $1 - the "show/hide" command, with the text taken from either {{msg-mw|Show}} or {{msg-mw|Hide}}
+* $1 - the "show/hide" command, with the text taken from either {{msg-mw|rcshowhideanons-show}} or {{msg-mw|showhideanons-hide}}
 {{Identical|Anonymous user}}',
+'rcshowhideanons-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideanons}}.
+
+See also:
+* {{msg-mw|rcshowhideanons-hide}}
+{{Identical|Hide}}',
+'rcshowhideanons-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideanons}}.
+
+See also:
+* {{msg-mw|rcshowhideanons-show}}
+{{Identical|hide}}',
 'rcshowhidepatr' => 'Option text in [[Special:RecentChanges]]. Parameters:
-* $1 - the "show/hide" command, with the text taken from either {{msg-mw|Show}} or {{msg-mw|Hide}}',
+* $1 - the "show/hide" command, with the text taken from either {{msg-mw|rcshowhidepatr-show}} or {{msg-mw|rcshowhidepatr-hide}}',
+'rcshowhidepatr-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidepatr}}.
+
+See also:
+* {{msg-mw|rcshowhidepatr-hide}}
+{{Identical|Show}}',
+'rcshowhidepatr-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidepatr}}.
+
+See also:
+* {{msg-mw|rcshowhidepatr-show}}
+{{Identical|Hide}}',
 'rcshowhidemine' => 'Option text in [[Special:RecentChanges]]. Parameters:
-* $1 - the "show/hide" command, with the text taken from either {{msg-mw|Show}} or {{msg-mw|Hide}}',
+* $1 - the "show/hide" command, with the text taken from either {{msg-mw|rcshowhidemine-show}} or {{msg-mw|rcshowhidemine-hide}}',
+'rcshowhidemine-show' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidemine}}.
+
+See also:
+* {{msg-mw|rcshowhidemine-hide}}
+{{Identical|show}}',
+'rcshowhidemine-hide' => '{{doc-actionlink}}
+Option text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhidemine}}.
+
+See also:
+* {{msg-mw|rcshowhidemine-show}}
+{{Identical|hide}}',
 'rclinks' => "Used on [[Special:RecentChanges]].
 * \$1 - a list of different choices with number of pages to be shown.<br />&nbsp;Example: \"''50{{int:pipe-separator}}100{{int:pipe-separator}}250{{int:pipe-separator}}500\".
 * \$2 - a list of clickable links with a number of days for which recent changes are to be displayed.<br />&nbsp;Example: \"''1{{int:pipe-separator}}3{{int:pipe-separator}}7{{int:pipe-separator}}14{{int:pipe-separator}}30''\".
@@ -9573,7 +9645,7 @@ Quotation marks, for quoting, sometimes titles etc., depending on the language.
 
 See: [[w:Non-English usage of quotation marks|Non-English usage of quotation marks on Wikipedia]].
 
-Parameters: 
+Parameters:
 * $1 - text to be wrapped in quotation marks',
 
 # Multipage image navigation
index 8b76a6b..1380dde 100644 (file)
@@ -1318,11 +1318,23 @@ $wgMessageStructure = array(
                'rcnotefrom',
                'rclistfrom',
                'rcshowhideminor',
+               'rcshowhideminor-show',
+               'rcshowhideminor-hide',
                'rcshowhidebots',
+               'rcshowhidebots-show',
+               'rcshowhidebots-hide',
                'rcshowhideliu',
+               'rcshowhideliu-show',
+               'rcshowhideliu-hide',
                'rcshowhideanons',
+               'rcshowhideanons-show',
+               'rcshowhideanons-hide',
                'rcshowhidepatr',
+               'rcshowhidepatr-show',
+               'rcshowhidepatr-hide',
                'rcshowhidemine',
+               'rcshowhidemine-show',
+               'rcshowhidemine-hide',
                'rclinks',
                'diff',
                'hist',