From 0ac62c1732b60db08b6bf017e854c7eb5ede7278 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 27 Jun 2007 10:19:36 +0000 Subject: [PATCH] * (bug 10365) Localization of Special:Version Let English licence information hard coded to avoid any possibility to suppress this important text Sort extension functions, parser extension tags and parser extension tags alphabetically Use table for software information too. WTF needs/uses the hook 'SpecialVersionExtensionTypes'? Not documented anywhere in trunk. --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 2 +- includes/SpecialVersion.php | 122 ++++++++++++++++-------------- languages/messages/MessagesDe.php | 40 ++++++++++ languages/messages/MessagesEn.php | 20 +++++ maintenance/language/messages.inc | 22 ++++++ skins/monobook/handheld.css | 11 +-- skins/monobook/main.css | 9 ++- 8 files changed, 160 insertions(+), 67 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ef4f213ff8..b056200e4e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -109,6 +109,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN classes: mw-code, mw-css, mw-js) * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over usergroup assignment. +* (bug 10365) Localization of Special:Version == Bugfixes since 1.10 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 62f08685cd..fa44eb8158 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1197,7 +1197,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '77'; +$wgStyleVersion = '78'; # Server-side caching: diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index 0b63393e90..8c2fe9817c 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -26,14 +26,13 @@ class SpecialVersion { function execute() { global $wgOut; - $wgOut->addHTML( '
' ); $wgOut->addWikiText( $this->MediaWikiCredits() . + $this->systemInformation() . $this->extensionCredits() . $this->wgHooks() ); $wgOut->addHTML( $this->IPInfo() ); - $wgOut->addHTML( '
' ); } /**#@+ @@ -46,11 +45,11 @@ class SpecialVersion { * @static */ function MediaWikiCredits() { - $version = self::getVersion(); - $dbr = wfGetDB( DB_SLAVE ); + $ret = "

" . wfMsgExt( 'version-licence', array( 'parseinline' ) ) . "

\n"; - $ret = + $ret .= "__NOTOC__ +
This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''', copyright (C) 2001-2007 Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, @@ -70,11 +69,13 @@ class SpecialVersion { along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or [http://www.gnu.org/copyleft/gpl.html read it online] +
"; - * [http://www.mediawiki.org/ MediaWiki]: $version - * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ") - * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion(); - + $translation = wfMsgExt( 'version-licence-text', array( 'parseline' ) ); + if( !( wfEmptyMsg( 'version-licence-text', $translation ) || $translation == '-' || $translation == '' ) ) { + $ret .= "

" . wfMsgExt( 'version-licence-header', array( 'parseinline' ) ) . "

\n"; + $ret .= $translation; + } return str_replace( "\t\t", '', $ret ) . "\n"; } @@ -93,15 +94,15 @@ class SpecialVersion { return ''; $extensionTypes = array( - 'specialpage' => 'Special pages', - 'parserhook' => 'Parser hooks', - 'variable' => 'Variables', - 'other' => 'Other', + 'specialpage' => wfMsgExt( 'version-specialpages', array( 'parseinline' ) ), + 'parserhook' => wfMsgExt( 'version-parserhooks', array( 'parseinline' ) ), + 'variable' => wfMsgExt( 'version-variables', array( 'parseinline' ) ), + 'other' => wfMsgExt( 'version-other', array( 'parseinline' ) ), ); wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); - $out = "

Extensions

\n"; - $out .= wfOpenElement('table', array('id' => 'sv-ext') ); + $out = "

" . wfMsgExt( 'version-extensions', array( 'parseinline' ) ) . "

\n"; + $out .= Xml::openElement( 'table', array('id' => 'sv-ext', 'dir' => 'ltr' ) ); foreach ( $extensionTypes as $type => $text ) { if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) { @@ -122,27 +123,27 @@ class SpecialVersion { } if ( count( $wgExtensionFunctions ) ) { - $out .= $this->openExtType('Extension functions'); + $out .= $this->openExtType( wfMsgExt( 'version-extension-functions', array( 'parseinline' ) ) ); $out .= '' . $this->listToText( $wgExtensionFunctions ) . "\n"; } if ( $cnt = count( $tags = $wgParser->getTags() ) ) { for ( $i = 0; $i < $cnt; ++$i ) $tags[$i] = "<{$tags[$i]}>"; - $out .= $this->openExtType('Parser extension tags'); + $out .= $this->openExtType( wfMsgExt( 'version-parser-extensiontags', array( 'parseinline' ) ) ); $out .= '' . $this->listToText( $tags ). "\n"; } if( $cnt = count( $fhooks = $wgParser->getFunctionHooks() ) ) { - $out .= $this->openExtType('Parser function hooks'); + $out .= $this->openExtType( wfMsgExt( 'version-parser-function-hooks', array( 'parseinline' ) ) ); $out .= '' . $this->listToText( $fhooks ) . "\n"; } if ( count( $wgSkinExtensionFunction ) ) { - $out .= $this->openExtType('Skin extension functions'); + $out .= $this->openExtType( wfMsgExt( 'version-skin-extension-functions', array( 'parseinline' ) ) ); $out .= '' . $this->listToText( $wgSkinExtensionFunction ) . "\n"; } - $out .= wfCloseElement( 'table' ); + $out .= Xml::closeElement( 'table' ); return $out; } @@ -181,32 +182,65 @@ class SpecialVersion { $myWgHooks = $wgHooks; ksort( $myWgHooks ); - $ret = "

Hooks

\n" - . wfOpenElement('table', array('id' => 'sv-hooks') ) - . "Hook nameSubscribed by\n"; + $ret = "

" . wfMsgExt( 'version-hooks', array( 'parseinline' ) ) . "

\n"; + $ret .= Xml::openElement( 'table', array( 'id' => 'sv-hooks', 'dir' => 'ltr' ) ); + $ret .= " + " . wfMsgExt( 'version-hook-name', array( 'parseinline' ) ) . " + " . wfMsgExt( 'version-hook-subscribedby', array( 'parseinline' ) ) . " + \n"; foreach ($myWgHooks as $hook => $hooks) - $ret .= "$hook" . $this->listToText( $hooks ) . "\n"; + $ret .= " + $hook + " . $this->listToText( $hooks ) . " + \n"; - $ret .= ''; + $ret .= Xml::closeElement( 'table' ); return $ret; } else return ''; } + function systemInformation() { + $version = self::getVersion(); + $dbr = wfGetDB( DB_SLAVE ); + + $ret = "

" . wfMsgExt( 'version-system', array( 'parseinline' ) ) . "

\n"; + $ret .= Xml::openElement( 'table', array( 'id' => 'sv-software', 'dir' => 'ltr' ) ); + $ret .= " + " . wfMsgExt( 'version-software', array( 'parseinline' ) ) . " + " . wfMsgExt( 'version-version', array( 'parseinline' ) ) . " + + + [http://www.mediawiki.org/ MediaWiki]: + $version + + + [http://www.php.net/ PHP]: + " . phpversion() . " (" . php_sapi_name() . ") + + + " . $dbr->getSoftwareLink() . ": + " . $dbr->getServerVersion() . " + \n"; + $ret .= Xml::closeElement( 'table' ); + + return $ret; + } + private function openExtType($text, $name = null) { $opt = array( 'colspan' => 3 ); $out = ''; if(!$this->firstExtOpened) { // Insert a spacing line - $out .= '' . wfElement( 'td', $opt ) . "\n"; + $out .= '' . Xml::tags( 'td', $opt, '' ) . "\n"; } $this->firstExtOpened = false; if($name) { $opt['id'] = "sv-$name"; } - $out .= "" . wfElement( 'th', $opt, $text) . "\n"; + $out .= "" . Xml::tags( 'th', $opt, $text) . "\n"; return $out; } @@ -226,41 +260,15 @@ class SpecialVersion { * @return string */ function listToText( $list ) { - $cnt = count( $list ); - if ( $cnt == 1 ) { - // Enforce always returning a string - return (string)$this->arrayToString( $list[0] ); - } elseif ( $cnt == 0 ) { - return ''; + if ( count( $list ) ) { + sort( $list ); + return implode( ', ', $list ); } else { - $t = array_slice( $list, 0, $cnt - 1 ); - $one = array_map( array( &$this, 'arrayToString' ), $t ); - $two = $this->arrayToString( $list[$cnt - 1] ); - - return implode( ', ', $one ) . " and $two"; + return ''; } } - /** - * @static - * - * @param mixed $list Will convert an array to string if given and return - * the paramater unaltered otherwise - * @return mixed - */ - function arrayToString( $list ) { - if( is_object( $list ) ) { - $class = get_class( $list ); - return "($class)"; - } elseif ( ! is_array( $list ) ) { - return $list; - } else { - $class = get_class( $list[0] ); - return "($class, {$list[1]})"; - } - } - /** * Retrieve the revision number of a Subversion working directory. * diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index f145907220..5993b0280d 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -2292,6 +2292,46 @@ Bitte bestätigen Sie, dass Sie diese Seite wirklich neu erstellen möchten.", 'lag-warn-normal' => 'Bearbeitungen der letzten $1 Sekunden werden in dieser Liste noch nicht angezeigt.', 'lag-warn-high' => 'Auf Grund hoher Datenbankauslastung werden die Bearbeitungen der letzten $1 Sekunden in dieser Liste noch nicht angezeigt.', +# Special:Version +'version-extensions' => 'Installierte Erweiterungen', +'version-specialpages' => 'Spezialseiten', +'version-parserhooks' => 'Parser-Hooks', +'version-variables' => 'Variablen', +'version-other' => 'Anderes', +'version-hooks' => "Schnittstellen ''(Hooks)''", +'version-licence' => 'Lizenz-Informationen', +'version-licence-header' => 'Unverbindliche Übersetzung:', +'version-licence-text' => " + Dieses Wiki basiert auf '''[http://www.mediawiki.org/ MediaWiki]''', + die Urheberrechte (C) 2001-2007 liegen bei Magnus Manske, Brion Vibber, Lee Daniel Crocker, + Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, + Niklas Laxström, Domas Mituzas, Rob Church und anderen. + + MediaWiki ist eine freie Software; Sie dürfen sie weiterverteilen und/oder verändern, + sofern die Bedingungen der ''GNU General Public License'', veröffentlicht + durch die ''Free Software Foundation'' in Lizenzversion 2 oder + (nach Ihrer Wahl) jeder späteren Version, eingehalten werden. + + MediaWiki wird verteilt in der Hoffnung, dass sie nutzbar ist, + aber OHNE JEDE GARANTIE, es wird auch keine implizite GEBRAUCHSTAUGLICHKEIT + oder TAUGLICHKEIT FÜR BESONDERE ZWECKE zugesagt. + Siehe die ''GNU General Public License'' für weitere Details. + + Sie sollten eine [{{SERVER}}{{SCRIPTPATH}}/COPYING Kopie der ''GNU General Public License''] + zusammen mit dieser Software erhalten haben; falls diese fehlt, schreiben Sie an + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + oder [http://www.gnu.org/copyleft/gpl.html lesen Sie sie online]. +", # See [[Special:Version]] for the original licence text in English. +'version-system' => 'System-Informationen', +'version-extension-functions' => 'Funktionsaufrufe', +'version-parser-extensiontags' => "Parser-Erweiterungen ''(tags)''", +'version-parser-function-hooks' => 'Parser-Funktionen', +'version-skin-extension-functions' => 'Skin extension functions', +'version-hook-name' => 'Schnittstellenname', +'version-hook-subscribedby' => 'aufgerufen durch', +'version-software' => 'Software', +'version-Version' => 'Version', + ); ?> diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 57864be510..3f86b915dd 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2908,6 +2908,26 @@ Try normal preview.', 'lag-warn-high' => 'Due to high database server lag, changes newer than $1 seconds may not be shown in this list.', +# Special:Version +'version-extensions' => 'Installed extensions', +'version-specialpages' => 'Special pages', +'version-parserhooks' => 'Parser hooks', +'version-variables' => 'Variables', +'version-other' => 'Other', +'version-hooks' => 'Hooks', +'version-licence' => 'Licence information', +'version-licence-header' => 'Translation without obligation:', +'version-licence-text' => '-', # See [[Special:Version]] for the original licence text in English. +'version-system' => 'System information', +'version-extension-functions' => 'Extension functions', +'version-parser-extensiontags' => 'Parser extension tags', +'version-parser-function-hooks' => 'Parser function hooks', +'version-skin-extension-functions' => 'Skin extension functions', +'version-hook-name' => 'Hook name', +'version-hook-subscribedby' => 'Subscribed by', +'version-software' => 'Software', +'version-version' => 'Version', + ); ?> diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index b9eb636343..728bba2a66 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2130,6 +2130,26 @@ $wgMessageStructure = array( 'lag-warn-normal', 'lag-warn-high', ), + 'version' => array( + 'version-extensions', + 'version-specialpages', + 'version-parserhooks', + 'version-variables', + 'version-other', + 'version-hooks', + 'version-licence', + 'version-licence-header', + 'version-licence-text', + 'version-system', + 'version-extension-functions', + 'version-parser-extensiontags', + 'version-parser-function-hooks', + 'version-skin-extension-functions', + 'version-hook-name', + 'version-hook-subscribedby', + 'version-software', + 'version-version', + ), ); /** Comments for each block */ $wgBlockComments = array( @@ -2296,6 +2316,7 @@ Variants for Chinese language", 'sizeunits' => 'Size units', 'livepreview' => 'Live preview', 'lagwarning' => 'Friendlier slave lag warnings', + 'version' => 'Special:Version', ); /** Short comments for standalone messages */ @@ -2314,6 +2335,7 @@ $wgMessageComments = array( 'exif-orientation-7' => '0th row: right; 0th column: bottom', 'exif-orientation-8' => '0th row: left; 0th column: bottom', 'autoredircomment' => 'This should be changed to the new naming convention, but existed beforehand', + 'version-version' => 'See [[Special:Version]] for the original licence text in English.', ); /** Messages which contain dollar signs (which are not followed by numbers), and therefore should use a single apostrophe */ diff --git a/skins/monobook/handheld.css b/skins/monobook/handheld.css index 8f77c96995..a4cc92b46f 100644 --- a/skins/monobook/handheld.css +++ b/skins/monobook/handheld.css @@ -1245,17 +1245,18 @@ table.multipageimage td { /** Special:Version */ -table#sv-ext, table#sv-hooks { +table#sv-ext, table#sv-hooks, table#sv-software { margin: 1em; padding:0em; + border-collapse: collapse; } -#sv-ext td, #sv-hooks td, -#sv-ext th, #sv-hooks th { +#sv-ext td, #sv-hooks td, #sv-software td +#sv-ext th, #sv-hooks th, #sv-software th { border: 1px solid #A0A0A0; padding: 0 0.15em 0 0.15em; } -#sv-ext th, #sv-hooks th { +#sv-ext th, #sv-hooks th, #sv-software th { background-color: #F0F0F0; color: black; padding: 0 0.15em 0 0.15em; @@ -1299,4 +1300,4 @@ tr.sv-space td { display: none; } /* Kill big bulky stuff that will clog up the screen */ display: none; } -} \ No newline at end of file +} diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 7b8a08616c..44b7fde3f8 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1539,17 +1539,18 @@ table.multipageimage td { /** Special:Version */ -table#sv-ext, table#sv-hooks { +table#sv-ext, table#sv-hooks, table#sv-software { margin: 1em; padding:0em; + border-collapse: collapse; } -#sv-ext td, #sv-hooks td, -#sv-ext th, #sv-hooks th { +#sv-ext td, #sv-hooks td, #sv-software td, +#sv-ext th, #sv-hooks th, #sv-software th { border: 1px solid #A0A0A0; padding: 0 0.15em 0 0.15em; } -#sv-ext th, #sv-hooks th { +#sv-ext th, #sv-hooks th, #sv-software th { background-color: #F0F0F0; color: black; padding: 0 0.15em 0 0.15em; -- 2.20.1