r112966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112965‎ | r112966 | r112967 >
Date:01:54, 4 March 2012
Author:robin
Status:ok (Comments)
Tags:
Comment:
* Set info pages in the user language
* Pass any language code as page content language by using Language::factory() instead of letting it fallback to English in wfGetLangObj()
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -678,7 +678,7 @@
679679
680680 /**
681681 * Make the page content language depend on the test wiki
682 - * Only works for codes that are known to MediaWiki :(
 682+ * Info pages are in the user language, they're localised
683683 */
684684 static function onPageContentLanguage( $title, &$pageLang ) {
685685 global $wmincTestWikiNamespaces, $wgOut;
@@ -687,10 +687,8 @@
688688 $wmincTestWikiNamespaces ) ) {
689689 return true;
690690 }
691 - if( $prefix['prefix'] == $title->getText() ) {
692 - return true; # Not for info pages (prefix == title)
693 - }
694 - $pageLang = $prefix['lang'];
 691+ $pageLang = $prefix['prefix'] == $title->getText() ?
 692+ $wgLang : Language::factory( $prefix['lang'] );
695693 return true;
696694 }
697695

Follow-up revisions

RevisionCommit summaryAuthorDate
r112978follow-up r112966: remove unused global, add missing globalrobin16:58, 4 March 2012

Comments

#Comment by Nikerabbit (talk | contribs)   08:01, 6 March 2012

What is an info page in this context?

#Comment by SPQRobin (talk | contribs)   14:43, 7 March 2012

A page in the format "Wx/xyz", which contains basic info about the language & project, see e.g. incubator:Wp/vep

#Comment by Nikerabbit (talk | contribs)   15:30, 7 March 2012

That should go into the code.

#Comment by SPQRobin (talk | contribs)   16:48, 7 March 2012

It's a central concept with even a dedicated InfoPage class, I'm sure it's explained several times in the code :)

Status & tagging log