From 311faa145c6add62653587594d6ff804a84b9163 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sat, 31 Jan 2009 17:34:47 +0000 Subject: [PATCH] * (bug 7556) Time zone names in signatures lack i18n --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 3 +++ includes/parser/Parser.php | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7f9976c325..0f4c86b5ec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -76,6 +76,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The {{NAMESPACE}}, {{TALKSPACE}}, and {{SUBJECTSPACE}} magic words can now be used as parser functions to return the desired namespace for a given title. * Styled #mw-data-after-content in cologneblue.css to match the rest of the font (bug 17110) +* (bug 7556) Time zone names in signatures lack i18n === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a31ecd60b9..7012e1f093 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2737,6 +2737,9 @@ $wgBrowserBlackList = array( * * This variable is currently used ONLY for signature formatting, not for * anything else. + * + * Timezones can be translated by editing MediaWiki messages of type + * timezone-nameinlowercase like timezone-utc. */ # $wgLocaltimezone = 'GMT'; # $wgLocaltimezone = 'PST8PDT'; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index f2a84474f0..76161b2406 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3715,6 +3715,15 @@ class Parser putenv( 'TZ='.$wgLocaltimezone ); $ts = date( 'YmdHis', $unixts ); $tz = date( 'T', $unixts ); # might vary on DST changeover! + + /* Allow translation of timezones trough wiki. date() can return + * whatever crap the system uses, localised or not, so we cannot + * ship premade translations. + */ + $key = 'timezone-' . strtolower( trim( $tz ) ); + $value = wfMsgForContent( $key ); + if ( !wfEmptyMsg( $key, $value ) ) $tz = $value; + putenv( 'TZ='.$oldtz ); } -- 2.20.1