r113914 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113913‎ | r113914 | r113915 >
Date:14:14, 15 March 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Fixing this fixme since it was reported as bug in twn
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -225,6 +225,7 @@
226226
227227 // This way the parser knows to fragment the parser cache by language code
228228 $userLangCode = $parser->getOptions()->getUserLang();
 229+ $sourceLanguage = $page->getMessageGroup()->getSourceLanguage();
229230
230231 $languages = array();
231232 foreach ( $status as $code => $percent ) {
@@ -249,8 +250,7 @@
250251 ) );
251252
252253 // Add links to other languages
253 - // @FIXME: 'en' should be the source language, not hardcoded
254 - $suffix = ( $code === 'en' ) ? '' : "/$code";
 254+ $suffix = ( $code === $sourceLanguage ) ? '' : "/$code";
255255 $_title = Title::makeTitle( $title->getNamespace(), $title->getDBkey() . $suffix );
256256 if ( intval( $percent ) === 0 ) {
257257 /* When language is included because it is a priority language,

Status & tagging log