r110297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110296‎ | r110297 | r110298 >
Date:15:44, 30 January 2012
Author:grafzahl
Status:deferred
Tags:
Comment:
Improve two error messages
Modified paths:
  • /trunk/extensions/Score/Score.body.php (modified) (history)
  • /trunk/extensions/Score/Score.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Score/Score.i18n.php
@@ -37,7 +37,7 @@
3838 'score-desc' => 'Adds a tag for rendering musical scores with LilyPond',
3939 'score-getcwderr' => 'Unable to obtain current working directory',
4040 'score-invalidlang' => 'Invalid score language lang="<nowiki>$1</nowiki>". Currently recognised languages are lang="lilypond" (the default) and lang="ABC".',
41 - 'score-invalidoggoverride' => 'The file you specified with override_ogg is invalid. Please specify the file name only, omit <nowiki>[[…]]</nowiki> and the "{{ns:file}}:" prefix.',
 41+ 'score-invalidoggoverride' => 'The file "<nowiki>$1</nowiki>" you specified with override_ogg is invalid. Please specify the file name only, omit <nowiki>[[…]]</nowiki> and the "{{ns:file}}:" prefix.',
4242 'score-noabcinput' => 'ABC source file $1 could not be created.',
4343 'score-noimages' => 'No score images were generated. Please check your score code.',
4444 'score-noinput' => 'Failed to create LilyPond input file $1.',
@@ -48,7 +48,7 @@
4949 'score-novorbislink' => 'Unable to generate Ogg/Vorbis link: $1',
5050 'score-oggconversionerr' => 'Unable to convert MIDI to Ogg/Vorbis:
5151 $1',
52 - 'score-oggoverridenotfound' => 'The file you specified with override_ogg does not exist.',
 52+ 'score-oggoverridenotfound' => 'The file "<nowiki>$1</nowiki>" you specified with override_ogg does not exist.',
5353 'score-page' => 'Page $1',
5454 'score-pregreplaceerr' => 'PCRE regular expression replacement failed',
5555 'score-readerr' => 'Unable to read file $1.',
@@ -72,7 +72,7 @@
7373 'score-desc' => '{{desc}}',
7474 'score-getcwderr' => 'Displayed if the extension cannot obtain the current working directory.',
7575 'score-invalidlang' => 'Displayed if the lang="…" attribute contains an unrecognised score language. $1 is the unrecognised language.',
76 - 'score-invalidoggoverride' => 'Displayed if the file specified with the override_ogg="…" attribute is invalid.',
 76+ 'score-invalidoggoverride' => 'Displayed if the file specified with the override_ogg="…" attribute is invalid. $1 is the value of the override_ogg attribute.',
7777 'score-noabcinput' => 'Displayed if an ABC source file could not be created for lang="ABC". $1 is the path to the file that could not be created.',
7878 'score-noimages' => 'Displayed if no score images were rendered.',
7979 'score-noinput' => 'Displayed if the LilyPond input file cannot be created. $1 is the path to the input file.',
@@ -82,7 +82,7 @@
8383 'score-notexecutable' => 'Displayed if LilyPond binary cannot be executed. $1 is the path to the LilyPond binary.',
8484 'score-novorbislink' => 'Displayed if an Ogg/Vorbis link could not be generated. $1 is the explanation why.',
8585 'score-oggconversionerr' => 'Displayed if the MIDI to Ogg/Vorbis conversion failed. $1 is the error (generally big block of text in a pre tag)',
86 - 'score-oggoverridenotfound' => 'Displayed if the file specified with the override_ogg="…" attribute could not be found.',
 86+ 'score-oggoverridenotfound' => 'Displayed if the file specified with the override_ogg="…" attribute could not be found. $1 is the value of the override_ogg attribute.',
8787 'score-page' => 'The word "Page" as used in pagination. $1 is the page number',
8888 'score-pregreplaceerr' => 'Displayed if a PCRE regular expression replacement failed.',
8989 'score-readerr' => 'Displayed if the extension could not read a file. $1 is the path to the file that could not be read.',
Index: trunk/extensions/Score/Score.body.php
@@ -234,10 +234,10 @@
235235 if ( array_key_exists( 'override_ogg', $args ) ) {
236236 $t = Title::newFromText( $args['override_ogg'], NS_FILE );
237237 if ( is_null( $t ) ) {
238 - throw new ScoreException( wfMessage( 'score-invalidoggoverride' ) );
 238+ throw new ScoreException( wfMessage( 'score-invalidoggoverride', htmlspecialchars( $args['override_ogg'] ) ) );
239239 }
240240 if ( !$t->isKnown() ) {
241 - throw new ScoreException( wfMessage( 'score-oggoverridenotfound' ) );
 241+ throw new ScoreException( wfMessage( 'score-oggoverridenotfound', htmlspecialchars( $args['override_ogg'] ) ) );
242242 }
243243 $options['override_ogg'] = true;
244244 $options['ogg_name'] = $args['override_ogg'];

Status & tagging log