(bug 1495) Enable on-wiki message language fallbacks
authorMatthew Walker <mwalker@wikimedia.org>
Wed, 16 Jan 2013 07:28:54 +0000 (23:28 -0800)
committerMwalker <mwalker@wikimedia.org>
Wed, 6 Mar 2013 19:54:02 +0000 (19:54 +0000)
commitd434bfcf3bbab05660ed8f798a4622487dd8ba56
treeda76d13e0ea370214ae29cd5a1d07ee056a61aac
parent019ede87172494f1e2352926095b81d201723eee
(bug 1495) Enable on-wiki message language fallbacks

The core function behind wfMessage() (MessageCache->get()) did not
apply the language fallback chain to on-wiki messages.

This patch has changed the behavior to iterate over all possible
on-wiki fallbacks (starting with the user's language) before
using the built-in language cache (CDB files). Previously we only looked
for the existence of an on-wiki message in the users's language.

Performance wise, using the 'ab' language ('ru', 'en' fallbacks)
MessageCache::get (Averaged over runs and calls)
New Code: ~8.5% TET (110us/call)
Old Code: ~6.5% TET ( 90us/call)

TET: Total Execution Time

Change-Id: Iaaf6ccebd8c40c9602748c58c3a5c73c29e7aa4d
includes/cache/MessageCache.php
languages/Language.php
tests/phpunit/includes/cache/MessageCacheTest.php [new file with mode: 0644]