r58358 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58357‎ | r58358 | r58359 >
Date:12:07, 30 October 2009
Author:catrope
Status:ok (Comments)
Tags:
Comment:
LocalisationUpdate: Fix bug where languages with '-' in their name would not get updates. Thanks to [[User:Don Alessandro]] on translatewiki.net for helping investigate this.
Modified paths:
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -192,7 +192,7 @@
193193 // Get the languagecode
194194 $m = array();
195195 preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $basefile, $m );
196 - $langcode = strtolower( $m[1] );
 196+ $langcode = str_replace( '_', '-', strtolower( $m[1] ) );
197197
198198 $basefilecontents = self::getFileContents( $basefile );
199199 if ( $basefilecontents === false || $basefilecontents === "" ) return array(); // Failed

Follow-up revisions

RevisionCommit summaryAuthorDate
r58359wmf-deployment: Merge r58358 (fix LocalisationUpdate for languages with '-' i...catrope12:08, 30 October 2009
r60721Per CR on r58358, refactor obtaining the language code from a filename into L...catrope10:20, 6 January 2010

Comments

#Comment by Tim Starling (talk | contribs)   03:57, 5 January 2010

I suggest refactoring this into a new static method Language::getCodeFromFileName(), which would do the inverse of the existing Language::getFileName(). Language::getLanguageNames() would also benefit from it.

Status & tagging log