Change copy of talk page link in personal tools
authorOri Livneh <ori@wikimedia.org>
Sun, 4 Nov 2012 09:02:43 +0000 (01:02 -0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 9 Nov 2012 00:30:36 +0000 (00:30 +0000)
Adds message with key "mytalk-parenthetical", specifying the
text for "Talk" when it is wrapped in parentheses and
conjoined to the user page label.

Change is guarded by config variable "wgVectorCombineUserTalk",
set to false by default (which preserves the old behavior).

Per discussion on IRC and in
https://bugzilla.wikimedia.org/show_bug.cgi?id=41672

Change-Id: I822a73901c9b220983356e9e4a4ad5e7f8ebc7f1

includes/DefaultSettings.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
skins/Vector.php

index e57b9d7..494b2a3 100644 (file)
@@ -2781,6 +2781,13 @@ $wgFooterIcons = array(
  */
 $wgUseCombinedLoginLink = false;
 
+/**
+ *  Appearance of user page and talk page labels in personal tools.
+ *  - true = combine links into a single label
+ *  - false = keep links in separate labels
+ */
+$wgVectorCombineUserTalk = false;
+
 /**
  * Search form look for Vector skin only.
  *  - true = use an icon search button
index ab5e6a3..ec31872 100644 (file)
@@ -767,16 +767,17 @@ XHTML id names.
 
 'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it
 
-'about'         => 'About',
-'article'       => 'Content page',
-'newwindow'     => '(opens in new window)',
-'cancel'        => 'Cancel',
-'moredotdotdot' => 'More...',
-'mypage'        => 'Page',
-'mytalk'        => 'Talk',
-'anontalk'      => 'Talk for this IP address',
-'navigation'    => 'Navigation',
-'and'           => '&#32;and',
+'about'                => 'About',
+'article'              => 'Content page',
+'newwindow'            => '(opens in new window)',
+'cancel'               => 'Cancel',
+'moredotdotdot'        => 'More...',
+'mypage'               => 'Page',
+'mytalk'               => 'Talk',
+'mytalk-parenthetical' => 'talk',
+'anontalk'             => 'Talk for this IP address',
+'navigation'           => 'Navigation',
+'and'                  => '&#32;and',
 
 # Cologne Blue skin
 'qbfind'         => 'Find',
index 2b3c976..a601b93 100644 (file)
@@ -347,9 +347,8 @@ Possible alternatives to the word 'content' are 'subject matter' or 'wiki subjec
 {{Identical|Cancel}}',
 'moredotdotdot' => '{{Identical|More...}}',
 'mypage' => "A text for the link to the user's user page in the links at the top of the page.",
-'mytalk' => 'In the personal urls page section - right upper corner.
-
-Used as link title in "Personal tools" toolbar.',
+'mytalk' => 'Used as link title in "Personal tools" toolbar.',
+'mytalk-parenthetical' => 'When user page and talk combined into single label, link title for talk label',
 'anontalk' => 'Link to the talk page appearing in [[mw:Help:Navigation#User_Links|user links]] for each anonymous users when [[mw:Manual:$wgShowIPinHeader|$wgShowIPinHeader]] is true.',
 'navigation' => 'This is shown as a section header in the sidebar of most skins.
 
index 7fbca41..227d18d 100644 (file)
@@ -361,7 +361,7 @@ class VectorTemplate extends BaseTemplate {
         * @param $elements array
         */
        protected function renderNavigation( $elements ) {
-               global $wgVectorUseSimpleSearch;
+               global $wgVectorUseSimpleSearch, $wgVectorCombineUserTalk;
 
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
@@ -444,10 +444,26 @@ class VectorTemplate extends BaseTemplate {
 <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg( 'personaltools' ) ?></h5>
        <ul<?php $this->html( 'userlangattributes' ) ?>>
-<?php                  foreach( $this->getPersonalTools() as $key => $item ) { ?>
-               <?php echo $this->makeListItem( $key, $item ); ?>
-
-<?php                  } ?>
+<?php
+                                       $personalTools = $this->getPersonalTools();
+                                       if ( $wgVectorCombineUserTalk && isset( $personalTools['userpage'] ) ) {
+?>
+               <li>
+<?php
+                                               echo $this->makeListItem( 'userpage', $personalTools['userpage'], array( 'tag' => 'span' ) );
+?> <?php
+                                               $personalTools['mytalk']['links'][0]['text'] = $this->getMsg( 'mytalk-parenthetical' )->text();
+                                               $talkItem = $this->makeListItem( 'mytalk', $personalTools['mytalk'], array( 'tag' => 'span' ) );
+                                               echo $this->getMsg( 'parentheses' )->rawParams( $talkItem )->escaped();
+                                               unset( $personalTools['userpage'], $personalTools['mytalk'] );
+?>
+               </li>
+<?php
+                                       }
+                                       foreach ( $personalTools as $key => $item ) {
+                                               echo $this->makeListItem( $key, $item );
+                                       }
+?>
        </ul>
 </div>
 <?php