http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94248

Revision: 94248
Author:   robin
Date:     2011-08-11 14:52:57 +0000 (Thu, 11 Aug 2011)
Log Message:
-----------
Add 2 @since and add documentation for PageContentLanguage hook

Modified Paths:
--------------
    trunk/extensions/WikimediaIncubator/IncubatorTest.php
    trunk/phase3/docs/hooks.txt
    trunk/phase3/includes/Title.php
    trunk/phase3/languages/Language.php

Modified: trunk/extensions/WikimediaIncubator/IncubatorTest.php
===================================================================
--- trunk/extensions/WikimediaIncubator/IncubatorTest.php       2011-08-11 
14:47:18 UTC (rev 94247)
+++ trunk/extensions/WikimediaIncubator/IncubatorTest.php       2011-08-11 
14:52:57 UTC (rev 94248)
@@ -631,6 +631,11 @@
                return true;
        }
 
+       /**
+        * Make the page content language depend on the test wiki
+        * Only works for codes that are known to MediaWiki :(
+        * @return true
+        */
        static function onPageContentLanguage( $title, &$pageLang ) {
                global $wmincTestWikiNamespaces, $wgOut;
                $prefix = self::analyzePrefix( $title->getText(), /* 
onlyInfoPage*/ false );

Modified: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt 2011-08-11 14:47:18 UTC (rev 94247)
+++ trunk/phase3/docs/hooks.txt 2011-08-11 14:52:57 UTC (rev 94248)
@@ -1290,6 +1290,12 @@
 $links: array, intended to hold the result. Must be an associative array with
        category types as keys and arrays of HTML links as values.
 
+'PageContentLanguage': allows changing the language in which the content of
+a page is written. Defaults to the wiki content language ($wgContLang).
+$title: Title object
+&$pageLang: the page content language (either an object or a language code)
+$wgLang: the user language
+
 'PageHistoryBeforeList': When a history page list is about to be constructed.
 $article: the article that the history is loading for
 

Modified: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2011-08-11 14:47:18 UTC (rev 94247)
+++ trunk/phase3/includes/Title.php     2011-08-11 14:52:57 UTC (rev 94248)
@@ -4277,6 +4277,7 @@
         * Defaults to $wgContLang, but in certain cases it can be e.g.
         * $wgLang (such as special pages, which are in the user language).
         *
+        * @since 1.18
         * @return object Language
         */
        public function getPageLanguage() {

Modified: trunk/phase3/languages/Language.php
===================================================================
--- trunk/phase3/languages/Language.php 2011-08-11 14:47:18 UTC (rev 94247)
+++ trunk/phase3/languages/Language.php 2011-08-11 14:52:57 UTC (rev 94248)
@@ -218,6 +218,7 @@
         *
         * @param $code string
         *
+        * @since 1.18
         * @return bool
         */
        public static function isValidBuiltInCode( $code ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to