r23701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23700‎ | r23701 | r23702 >
Date:11:28, 4 July 2007
Author:raymond
Status:old
Tags:
Comment:
Make the long existing message 'spam-whitelist' available to [[Special:Allmessages]].
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist.i18n.php (added) (history)
  • /trunk/extensions/SpamBlacklist/SpamBlacklist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist.php
@@ -26,6 +26,16 @@
2727 'description' => 'Regex based anti spam tool',
2828 );
2929
 30+$wgExtensionFunctions[] = 'wfSpamBlacklistMessageLoader';
 31+
 32+function wfSpamBlacklistMessageLoader() {
 33+ global $wgMessageCache;
 34+ require_once( 'SpamBlacklist.i18n.php' );
 35+ foreach( efSpamBlacklistMessages() as $lang => $messages ) {
 36+ $wgMessageCache->addMessages( $messages, $lang );
 37+ }
 38+}
 39+
3040 function wfSpamBlacklistLoader( &$title, $text, $section ) {
3141 require_once( "SpamBlacklist_body.php" );
3242 static $spamObj = false;
@@ -44,3 +54,4 @@
4555
4656 } # End invocation guard
4757
 58+
Index: trunk/extensions/SpamBlacklist/SpamBlacklist.i18n.php
@@ -0,0 +1,29 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for SpamBlacklist extension.
 5+ *
 6+ * @addtogroup Extensions
 7+*/
 8+
 9+/**
 10+ * Prepare extension messages
 11+ *
 12+ * @return array
 13+ */
 14+function efSpamBlacklistMessages() {
 15+ $messages = array(
 16+
 17+'en' => array(
 18+ 'spam-whitelist' => '
 19+ #<!-- leave this line exactly as it is --> <pre>
 20+# Syntax is as follows:
 21+# * Everything from a "#" character to the end of the line is a comment
 22+# * Every non-blank line is a regex fragment which will only match hosts inside URLs
 23+
 24+ #</pre> <!-- leave this line exactly as it is -->',
 25+)
 26+
 27+);
 28+
 29+return $messages;
 30+}
Property changes on: trunk/extensions/SpamBlacklist/SpamBlacklist.i18n.php
___________________________________________________________________
Added: svn:eol-style
131 + native

Status & tagging log