* Caches that need purging ability now use the WANObjectCache interface.
This corresponds to a new $wgMainWANCache setting, which defaults to using
the $wgMainCacheType settings.
+* Added MWTimestamp::getTimezoneString() which returns the localized timezone
+ string, if available. To localize this string, see the comments of
+ $wgLocaltimezone in includes/DefaultSettings.php.
* Callers needing fast light-weight data stores use $wgMainStash to select
the store type from $wgObjectCaches. The default is the local database.
* Interface message overrides in the MediaWiki namespace will now be cached in
* Watchlist tokens, SpecialResetTokens, and User::getTokenFromOption()
are deprecated. Applications using those can work via the OAuth
extension instead. New tokens types should not be added.
+* (T36948) The default file revert message's timestamp is now in $wgLocaltimezone,
+ instead of UTC.
* DatabaseBase::errorCount() was removed (unused).
* $wgDeferredUpdateList was removed.
* DeferredUpdates::addHTMLCacheUpdate() was removed.
return $this->timestamp->getTimezone();
}
+ /**
+ * Get the localized timezone message, if available.
+ *
+ * Premade translations are not shipped as format() may return whatever the
+ * system uses, localized or not, so translation must be done through wiki.
+ *
+ * @since 1.25
+ * @return Message The localized timezone message
+ */
+ public function getTimezoneMessage() {
+ $tzMsg = $this->format( 'T' ); // might vary on DST changeover!
+ $key = 'timezone-' . strtolower( trim( $tzMsg ) );
+ $msg = wfMessage( $key );
+ if ( $msg->exists() ) {
+ return $msg;
+ } else {
+ return new RawMessage( $tzMsg );
+ }
+ }
+
/**
* Format the timestamp in a given format.
*
$lang = $this->getLanguage();
$userDate = $lang->userDate( $timestamp, $user );
$userTime = $lang->userTime( $timestamp, $user );
- $siteDate = $wgContLang->date( $timestamp, false, false );
- $siteTime = $wgContLang->time( $timestamp, false, false );
+ $siteTs = MWTimestamp::getLocalInstance( $timestamp );
+ $ts = $siteTs->format( 'YmdHis' );
+ $siteDate = $wgContLang->date( $ts, false, false );
+ $siteTime = $wgContLang->time( $ts, false, false );
+ $tzMsg = $siteTs->getTimezoneMessage()->inContentLanguage()->text();
return array(
'intro' => array(
'comment' => array(
'type' => 'text',
'label-message' => 'filerevert-comment',
- 'default' => $this->msg( 'filerevert-defaultcomment', $siteDate, $siteTime
- )->inContentLanguage()->text()
+ 'default' => $this->msg( 'filerevert-defaultcomment', $siteDate, $siteTime,
+ $tzMsg )->inContentLanguage()->text()
)
);
}
$ts = $this->mOptions->getTimestamp();
$timestamp = MWTimestamp::getLocalInstance( $ts );
$ts = $timestamp->format( 'YmdHis' );
- $tzMsg = $timestamp->format( 'T' ); # might vary on DST changeover!
-
- # Allow translation of timezones through wiki. format() can return
- # whatever crap the system uses, localised or not, so we cannot
- # ship premade translations.
- $key = 'timezone-' . strtolower( trim( $tzMsg ) );
- $msg = wfMessage( $key )->inContentLanguage();
- if ( $msg->exists() ) {
- $tzMsg = $msg->text();
- }
+ $tzMsg = $timestamp->getTimezoneMessage()->inContentLanguage()->text();
$d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)";
"filerevert-legend": "Revert file",
"filerevert-intro": "You are about to revert the file <strong>[[Media:$1|$1]]</strong> to the [$4 version as of $3, $2].",
"filerevert-comment": "Reason:",
- "filerevert-defaultcomment": "Reverted to version as of $2, $1",
+ "filerevert-defaultcomment": "Reverted to version as of $2, $1 ($3)",
"filerevert-submit": "Revert",
"filerevert-success": "<strong>[[Media:$1|$1]]</strong> has been reverted to the [$4 version as of $3, $2].",
"filerevert-badversion": "There is no previous local version of this file with the provided timestamp.",
"filerevert-legend": "{{Identical|Revert}}",
"filerevert-intro": "Message displayed when you try to revert a version of a file.\n* $1 is the name of the media\n* $2 is a date\n* $3 is a time\n* $4 is a URL and must follow square bracket: [$4\n{{Identical|Revert}}",
"filerevert-comment": "{{Identical|Reason}}",
- "filerevert-defaultcomment": "Parameters:\n* $1 - a date\n* $2 - a time\n{{Identical|Revert}}",
+ "filerevert-defaultcomment": "Parameters:\n* $1 - a date\n* $2 - a time\n* $3 - a timezone\n{{Identical|Revert}}",
"filerevert-submit": "{{Identical|Revert}}",
"filerevert-success": "Message displayed when you succeed in reverting a version of a file.\n* $1 is the name of the media\n* $2 is a date\n* $3 is a time\n* $4 is an URL and must follow square bracket: [$4\n{{Identical|Revert}}",
"filerevert-badversion": "Used as error message.",