Move content language details to HTML comments; doesn't need to be immediately there...
authorRob Church <robchurch@users.mediawiki.org>
Sun, 7 Jan 2007 01:53:44 +0000 (01:53 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 7 Jan 2007 01:53:44 +0000 (01:53 +0000)
RELEASE-NOTES
includes/SpecialVersion.php

index 76a4dd2..d0ebb1d 100644 (file)
@@ -470,7 +470,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8417) Handle EXIF unknown dates
 * (bug 8372) Return nothing on empty <math> tags.
 * New maintenance script to show the cached statistics : showStats.php.
-* Added language code and name in Special:Version next to MediaWiki version.
+* Emit content language information in a comment in Special:Version, for
+  debugging/support purposes
 * New special page to list available interwikis [[Special:Listinterwikis]]
 * Count deleted edits when regenerating total edits in maintenance/initStats.php
 
index e477181..668ab94 100644 (file)
@@ -33,6 +33,7 @@ class SpecialVersion {
                        $this->extensionCredits() .
                        $this->wgHooks()
                );
+               $wgOut->addHtml( self::getLanguageInfo() );
                $wgOut->addHTML( $this->IPInfo() );
                $wgOut->addHTML( '</div>' );
        }
@@ -75,7 +76,7 @@ class SpecialVersion {
                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 ($wgLanguageCode $mwlang)
+               * [http://www.mediawiki.org/ MediaWiki]: $version
                * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
                * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion();
 
@@ -290,6 +291,18 @@ class SpecialVersion {
                        return intval( $content[3] );
                }
        }
+       
+       /**
+        * Get the content language name and code, for debugging/support purposes
+        *
+        * @return string
+        */
+       private static function getLanguageInfo() {
+               global $wgContLang;
+               $code = $wgContLang->getCode();
+               $name = Language::getLanguageName( $code );
+               return '<!-- ' . htmlspecialchars( "Content Language: {$name} [{$code}]" ) . ' -->';
+       }
 
        /**#@-*/
 }