Page MenuHomePhabricator

int messages are translated according to content language instead of user language in banners
Closed, ResolvedPublic

Description

When a banner is previewed in a language other than English, {{int:...}} messages don't get translated. This bug doesn't occur in the live CentralNotice on meta, but does occur locally. Banners served from the BannerLoader also do not have this problem.

Apparently {{int:...}} translation is broken if wfMsg() is called at any point before the translation with a messagekey set to a message that includes anything in double braces. In this case, the int messages just display in English rather than the requested language.

Since every SpecialPage is supposed to call setHeaders(), and since setHeaders() sets the page title using the 'pagetitle' message, which is defined as '$1 - {{SITENAME}}', the only way to avoid this is to move the setHeader() calls to the end of the code, which is rather messy.


Version: unspecified
Severity: trivial

Details

Reference
bz25031

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:10 PM
bzimport set Reference to bz25031.

Since this problem seems to only occur locally, and only for banner previews, I'm marking WONTFIX for now.

Reopening since it may be possible to fix this in the core code rather than in the extension.

Adding

<pre>
$popts->setUserLang( $language );
</pre>

to MessageCache::transform() fixes the problem. No idea if that breaks anything else.

  • Bug 25358 has been marked as a duplicate of this bug. ***

It looks like this is breaking {{int:...}} translation on the wikis as well (see Bug 25358). As soon as r70517 and r72555 are deployed, this should be fixed.

OK, this should be fixed on test.wikipedia.org now.