r49960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49959‎ | r49960 | r49961 >
Date:15:09, 27 April 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* update preferences handling; only show when relevant
* update README
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/utils/UserToggles.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -11,7 +11,7 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -define( 'TRANSLATE_VERSION', '11:2009-04-24' );
 15+define( 'TRANSLATE_VERSION', '11:2009-04-27' );
1616
1717 $wgExtensionCredits['specialpage'][] = array(
1818 'path' => __FILE__,
Index: trunk/extensions/Translate/README
@@ -33,7 +33,9 @@
3434 </code>
3535
3636 == Changes in version 11 ==
37 -* 2009-04-24 Updates preferences handling to work with MediaWiki 1.15a r49790 and up
 37+* 2009-04-27 Updated preferences handling; only show when relevant
 38+* 2009-04-24 Updated preferences handling to work with MediaWiki 1.15a r49790 and up
 39+* 2009-04-23 Link added to message group in the source message fieldset description
3840 * 2009-04-15 Added class 'mw-sp-translate-[id]' to all message groups on Special:Translate
3941 * 2009-04-04:2 Support added for NOCC
4042 * 2009-04-04:1 PhpVariables Mantis header inconsistency fixed
Index: trunk/extensions/Translate/utils/UserToggles.php
@@ -6,15 +6,23 @@
77 * Add preferences for Translate
88 */
99 public static function onGetPreferences( $user, &$preferences ) {
10 - // 'translate-pref-nonewsletter' is used as opt-out for
11 - // users with a confirmed e-mail address
12 - $preferences['translate'] =
13 - array(
14 - 'type' => 'toggle',
15 - 'section' => 'misc',
16 - 'label-message' => 'translate-pref-nonewsletter',
 10+ global $wgEnableEmail, $wgUser;
 11+
 12+ if ( $wgEnableEmail && $wgUser->isEmailConfirmed() ) {
 13+ // 'translate-pref-nonewsletter' is used as opt-out for
 14+ // users with a confirmed e-mail address
 15+ $prefs = array(
 16+ 'translate' => array(
 17+ 'type' => 'toggle',
 18+ 'section' => 'personal',
 19+ 'label-message' => 'translate-pref-nonewsletter'
 20+ )
1721 );
1822
 23+ // Add setting after 'enotifrevealaddr'
 24+ $preferences = wfArrayInsertAfter( $preferences, $prefs, 'enotifrevealaddr' );
 25+ }
 26+
1927 return true;
2028 }
2129 }
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -125,7 +125,7 @@
126126 'translate-checks-format' => 'This translation does not follow the definition or has invalid syntax: $1',
127127 'translate-checks-escape' => 'The following escapes may be accidental: <strong>$1</strong>',
128128
129 - 'translate-pref-nonewsletter' => 'Do not send me e-mail newsletters (relevant only for users with a confirmed e-mail address)',
 129+ 'translate-pref-nonewsletter' => 'Do not send me e-mail newsletters',
130130 'right-translate' => 'Edit using the translate interface',
131131
132132 'translate-rc-translation-filter' => 'Filter translations:',

Status & tagging log