From: Timo Tijhof Date: Tue, 15 Sep 2015 18:35:13 +0000 (+0100) Subject: resourceloader: Don't localise hidden exception X-Git-Tag: 1.31.0-rc.0~10012 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=19349af1401641cdf4eab0a43458debaf187741b;p=lhc%2Fweb%2Fwiklou.git resourceloader: Don't localise hidden exception Mechanical stacktraces are mostly program identifiers (which are English) with some glue text. When stacktraces are disabled by the site admin, the replacement message doesn't seem valuable to localise. And one could argue it should be in the user language instead of the site language in that case, which complicates the output buffer and caching layers for this. It also reduces coupling with MediaWiki (Ref T32956). Change-Id: If446f1b815add2be4baf1c333f18a4bab0cc9c37 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index da74b35280..173fcc1808 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -940,11 +940,11 @@ class ResourceLoader implements LoggerAwareInterface { protected static function formatExceptionNoComment( $e ) { global $wgShowExceptionDetails; - if ( $wgShowExceptionDetails ) { - return $e->__toString(); - } else { - return wfMessage( 'internalerror' )->text(); + if ( !$wgShowExceptionDetails ) { + return 'Internal error'; } + + return $e->__toString(); } /**