r49516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49515‎ | r49516 | r49517 >
Date:19:41, 15 April 2009
Author:raymond
Status:ok
Tags:
Comment:
Follow up r49442: Make this new error message and two older error messages localizable.
Modified paths:
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2004,6 +2004,9 @@
20052005 'djvu_no_xml',
20062006 'thumbnail_invalid_params',
20072007 'thumbnail_dest_directory',
 2008+ 'thumbnail_image-type',
 2009+ 'thumbnail_gd-library',
 2010+ 'thumbnail_image-missing',
20082011 ),
20092012 'import' => array(
20102013 'import',
Index: trunk/phase3/includes/media/Bitmap.php
@@ -181,20 +181,23 @@
182182 if( !isset( $typemap[$mimeType] ) ) {
183183 $err = 'Image type not supported';
184184 wfDebug( "$err\n" );
185 - return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
 185+ $errMsg = wfMsg ( 'thumbnail_image-type' );
 186+ return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $errMsg );
186187 }
187188 list( $loader, $colorStyle, $saveType ) = $typemap[$mimeType];
188189
189190 if( !function_exists( $loader ) ) {
190191 $err = "Incomplete GD library configuration: missing function $loader";
191192 wfDebug( "$err\n" );
192 - return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
 193+ $errMsg = wfMsg ( 'thumbnail_gd-library', $loader );
 194+ return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $errMsg );
193195 }
194196
195197 if ( !file_exists( $srcPath ) ) {
196198 $err = "File seems to be missing: $srcPath";
197199 wfDebug( "$err\n" );
198 - return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
 200+ $errMsg = wfMsg ( 'thumbnail_image-missing', $srcPath );
 201+ return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $errMsg );
199202 }
200203
201204 $src_image = call_user_func( $loader, $srcPath );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2866,6 +2866,9 @@
28672867 'djvu_no_xml' => 'Unable to fetch XML for DjVu file',
28682868 'thumbnail_invalid_params' => 'Invalid thumbnail parameters',
28692869 'thumbnail_dest_directory' => 'Unable to create destination directory',
 2870+'thumbnail_image-type' => 'Image type not supported',
 2871+'thumbnail_gd-library' => 'Incomplete GD library configuration: missing function $1',
 2872+'thumbnail_image-missing' => 'File seems to be missing: $1',
28702873
28712874 # Special:Import
28722875 'import' => 'Import pages',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49442If the file doesn't exist, we get a whole bunch of cascading PHP errors.demon15:05, 13 April 2009

Status & tagging log