From: Douglas Gardner Date: Fri, 24 Jan 2014 13:25:19 +0000 (+0000) Subject: Make show/hide link in RC individually localizable X-Git-Tag: 1.31.0-rc.0~16807^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=4986f91509bd0311e1c8504a7766693f651c1af1;p=lhc%2Fweb%2Fwiklou.git Make show/hide link in RC individually localizable 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 --- diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 90abe1ca3f..7083f68c82 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -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(); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 726b8f053c..c1f1333d44 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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
$3', 'diff' => 'diff', 'hist' => 'hist', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 5ab76d2f42..a50f75fc7e 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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.
 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.
 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 diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 8b76a6b7a9..1380ddeffd 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -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',