* @param $defaultPreferences
*/
static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
- global $wgUseRCPatrol, $wgEnableAPI;
+ global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
+ $watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) );
+
## Watchlist #####################################
$defaultPreferences['watchlistdays'] = array(
'type' => 'float',
'min' => 0,
- 'max' => 7,
+ 'max' => $watchlistdaysMax,
'section' => 'watchlist/displaywatchlist',
- 'help' => $context->msg( 'prefs-watchlist-days-max' )->escaped(),
+ 'help' => $context->msg( 'prefs-watchlist-days-max' )->numParams(
+ $watchlistdaysMax )->text(),
'label-message' => 'prefs-watchlist-days',
);
$defaultPreferences['wllimit'] = array(
'prefs-rc' => 'Recent changes',
'prefs-watchlist' => 'Watchlist',
'prefs-watchlist-days' => 'Days to show in watchlist:',
-'prefs-watchlist-days-max' => 'Maximum 7 days',
+'prefs-watchlist-days-max' => 'Maximum $1 {{PLURAL:$1|day|days}}',
'prefs-watchlist-edits' => 'Maximum number of changes to show in expanded watchlist:',
'prefs-watchlist-edits-max' => 'Maximum number: 1000',
'prefs-watchlist-token' => 'Watchlist token:',