r94248 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94247‎ | r94248 | r94249 >
Date:14:52, 11 August 2011
Author:robin
Status:ok
Tags:
Comment:
Add 2 @since and add documentation for PageContentLanguage hook
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1290,6 +1290,12 @@
12911291 $links: array, intended to hold the result. Must be an associative array with
12921292 category types as keys and arrays of HTML links as values.
12931293
 1294+'PageContentLanguage': allows changing the language in which the content of
 1295+a page is written. Defaults to the wiki content language ($wgContLang).
 1296+$title: Title object
 1297+&$pageLang: the page content language (either an object or a language code)
 1298+$wgLang: the user language
 1299+
12941300 'PageHistoryBeforeList': When a history page list is about to be constructed.
12951301 $article: the article that the history is loading for
12961302
Index: trunk/phase3/includes/Title.php
@@ -4277,6 +4277,7 @@
42784278 * Defaults to $wgContLang, but in certain cases it can be e.g.
42794279 * $wgLang (such as special pages, which are in the user language).
42804280 *
 4281+ * @since 1.18
42814282 * @return object Language
42824283 */
42834284 public function getPageLanguage() {
Index: trunk/phase3/languages/Language.php
@@ -218,6 +218,7 @@
219219 *
220220 * @param $code string
221221 *
 222+ * @since 1.18
222223 * @return bool
223224 */
224225 public static function isValidBuiltInCode( $code ) {
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -631,6 +631,11 @@
632632 return true;
633633 }
634634
 635+ /**
 636+ * Make the page content language depend on the test wiki
 637+ * Only works for codes that are known to MediaWiki :(
 638+ * @return true
 639+ */
635640 static function onPageContentLanguage( $title, &$pageLang ) {
636641 global $wmincTestWikiNamespaces, $wgOut;
637642 $prefix = self::analyzePrefix( $title->getText(), /* onlyInfoPage*/ false );

Follow-up revisions

RevisionCommit summaryAuthorDate
r94250merge r94248 (documentation relevant to 1.18)robin15:14, 11 August 2011

Status & tagging log