Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'TRANSLATE_VERSION', '11:2009-04-24' ); |
| 15 | +define( 'TRANSLATE_VERSION', '11:2009-04-27' ); |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'path' => __FILE__, |
Index: trunk/extensions/Translate/README |
— | — | @@ -33,7 +33,9 @@ |
34 | 34 | </code> |
35 | 35 | |
36 | 36 | == 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 |
38 | 40 | * 2009-04-15 Added class 'mw-sp-translate-[id]' to all message groups on Special:Translate |
39 | 41 | * 2009-04-04:2 Support added for NOCC |
40 | 42 | * 2009-04-04:1 PhpVariables Mantis header inconsistency fixed |
Index: trunk/extensions/Translate/utils/UserToggles.php |
— | — | @@ -6,15 +6,23 @@ |
7 | 7 | * Add preferences for Translate |
8 | 8 | */ |
9 | 9 | 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 | + ) |
17 | 21 | ); |
18 | 22 | |
| 23 | + // Add setting after 'enotifrevealaddr' |
| 24 | + $preferences = wfArrayInsertAfter( $preferences, $prefs, 'enotifrevealaddr' ); |
| 25 | + } |
| 26 | + |
19 | 27 | return true; |
20 | 28 | } |
21 | 29 | } |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | 'translate-checks-format' => 'This translation does not follow the definition or has invalid syntax: $1', |
127 | 127 | 'translate-checks-escape' => 'The following escapes may be accidental: <strong>$1</strong>', |
128 | 128 | |
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', |
130 | 130 | 'right-translate' => 'Edit using the translate interface', |
131 | 131 | |
132 | 132 | 'translate-rc-translation-filter' => 'Filter translations:', |