Page MenuHomePhabricator

Limit Report localization is wrong
Closed, ResolvedPublic

Description

The plural forms in the limit report are wrong on frwiki, for example:

CPU time usage: 0.026 second

instead of

CPU time usage: 0.026 seconds

The limit report is localized in mediawiki-core:includes/OutputTransform/Stages/RenderDebugInfo.php with the following code:

					$keyMsg = Message::newFromSpecifier( $key )->inLanguage( 'en' )->useDatabase( false );
					$valueMsg = Message::newFromSpecifier( "$key-value" )
						->inLanguage( 'en' )->useDatabase( false );
					if ( !$valueMsg->exists() ) {
						$valueMsg = new RawMessage( '$1' );
					}
					if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) {
						$valueMsg->params( $value );
						$limitReport .= "{$keyMsg->text()}: {$valueMsg->text()}\n";
					}
				}

which *ought* to force the message language to en, however local debugging with $wgLanguageCode='fr' shows that the parser target language is fr in CoreParserFunctions::plural.

This is probably a regression from Ib39d5b.

Event Timeline

Change #1152331 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Ensure MessageParser uses the correct isInterface and language

https://gerrit.wikimedia.org/r/1152331

Change #1152331 merged by jenkins-bot:

[mediawiki/core@master] Ensure MessageParser uses the correct isInterface and language

https://gerrit.wikimedia.org/r/1152331