r111614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111613‎ | r111614 | r111615 >
Date:02:48, 16 February 2012
Author:aaron
Status:ok (Comments)
Tags:i18nreview 
Comment:
live hack to deal with 500s on log/RC views
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/Translate/TranslateHooks.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/Translate/TranslateHooks.php
@@ -332,8 +332,10 @@
333333
334334 if ( $action === 'group' ) {
335335 $languageCode = $params[0];
336 - $languageNames = Language::getTranslatedLanguageNames( $languageCode );
337 - $languageName = "$languageNames[$languageCode] ($languageCode)";
 336+ #$languageNames = Language::getTranslatedLanguageNames( $languageCode );
 337+ #$languageName = "$languageNames[$languageCode] ($languageCode)";
 338+ # --aaron, don't load a bunch of languages on log view
 339+ $languageName = "$languageCode ($languageCode)";
338340 $groupLabel = $params[1];
339341 $oldState = $params[2];
340342 $newState = $params[3];

Follow-up revisions

RevisionCommit summaryAuthorDate
r111991Displaying the language name in the current user's language. Should work with...amire8004:57, 21 February 2012

Comments

#Comment by Siebrand (talk | contribs)   21:57, 16 February 2012

Any root cause analysis for this?

#Comment by Aaron Schulz (talk | contribs)   22:05, 16 February 2012

getTranslatedLanguageNames() has a hook to improve the language names beyond just using Names.php. CLDR and Translate have handlers. The later hook (the function translateMessageDocumentationLanguage()), tries to load the language name message using the respective language translations. This causes a bunch of calls to LocalisationCache::recache() as it tries to load in files for different languages. In profiling I'd see stuff like:

  • 95.86% 13.298977 8 - LocalisationCache::recache

Normally there is the content and user language, which are often the same, and that's it. MW struggles trying to load N languages where N is proportional to the number of log items on a page view. The hack I made stopped this from happening.

#Comment by Awjrichards (talk | contribs)   19:53, 17 February 2012

Is there a reason this fix hasn't been made in trunk as well?

#Comment by Awjrichards (talk | contribs)   18:41, 21 February 2012

Should have mentioned this in my first comment, but I originally left this rev marked as 'New' rather than 'OK' since this change still is not reflected in trunk. The divergence might cause headaches/problems down the line. Perhaps there's a good reason for this, but no one has mentioned it yet - Aaron?

Status & tagging log