r76519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76518‎ | r76519 | r76520 >
Date:15:38, 11 November 2010
Author:raymond
Status:ok
Tags:
Comment:
Move hardcoded error messages to i18n file
Modified paths:
  • /trunk/extensions/HTMLets/HTMLets.i18n.php (modified) (history)
  • /trunk/extensions/HTMLets/HTMLets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HTMLets/HTMLets.i18n.php
@@ -10,6 +10,8 @@
1111
1212 $messages['en'] = array(
1313 'htmlets-desc' => 'Lets you inline HTML snippets from files using the <code>&lt;htmlet&gt;</code> tag',
 14+ 'htmlets-filenotfound' => 'Cannot find HTML file $1',
 15+ 'htmlets-loadfailed' => 'Failed to load html file $1',
1416 );
1517
1618 /** Message documentation (Message documentation)
Index: trunk/extensions/HTMLets/HTMLets.php
@@ -89,11 +89,11 @@
9090 $f = "$dir/$name";
9191
9292 if ( !preg_match('!^\w+://!', $dir ) && !file_exists( $f ) ) {
93 - $output = '<div class="error">Can\'t find html file ' . htmlspecialchars( $name ) . '</div>';
 93+ $output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-filenotfound', htmlspecialchars( $name ) ) );
9494 } else {
9595 $output = file_get_contents( $f );
9696 if ( $output === false ) {
97 - $output = '<div class="error">Failed to load html file ' . htmlspecialchars( $name ) . '</div>';
 97+ $output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-loadfailed', htmlspecialchars( $name ) ) );
9898 }
9999 }
100100

Follow-up revisions

RevisionCommit summaryAuthorDate
r76521Follow-up r76519: html->HTMLraymond15:40, 11 November 2010

Status & tagging log