diff --git a/OreDict.body.php b/OreDict.body.php index d9a4e53..eaa3705 100755 --- a/OreDict.body.php +++ b/OreDict.body.php @@ -88,7 +88,7 @@ public function exec($byTag = false) { // Query database if (!isset(self::$mQueries[$this->mItemName][$this->mItemMod])) { if ($byTag) { - OreDictError::notice("Querying the ore dictionary for Tag = $this->mItemName Mod = $this->mItemMod"); + OreDictError::notice(wfMessage('oredict-query-notice')->params('Tag', $this->mItemName, $this->mItemMod)->text()); $result = $dbr->select( "ext_oredict_items", @@ -104,7 +104,7 @@ public function exec($byTag = false) { ] ); } else { - OreDictError::notice("Querying the ore dictionary for Item = $this->mItemName Mod = $this->mItemMod"); + OreDictError::notice(wfMessage('oredict-query-notice')->params('Item', $this->mItemName, $this->mItemMod)->text()); $subResult = $dbr->select( "ext_oredict_items", @@ -145,10 +145,10 @@ public function exec($byTag = false) { if (!isset(self::$mQueries[$this->mItemName][$this->mItemMod])) { self::$mQueries[$this->mItemName][$this->mItemMod][] = new OreDictItem($this->mItemName, '', $this->mItemMod,'',0xcf); - OreDictError::notice("OreDict returned an empty set (i.e. 0 rows)! Using provided params as is. Suppressing future identical warnings."); + OreDictError::notice(wfMessage('oredict-empty-query-notice')->text()); } else { $rows = $result->numRows(); - OreDictError::notice("OreDict returned $rows rows. "); + OreDictError::notice(wfMessage('oredict-nonempty-query-notice')->numParams($rows)->text()); } } @@ -431,33 +431,33 @@ class OreDictItem{ * @throws MWException Throws and MWException when input format is incorrect. */ public function __construct($item, $tag = '', $mod = '', $params = '') { - OreDictError::debug("Constructing OreDictItem."); + OreDictError::debug(wfMessage('oredictitem-constructor-debug')->text()); if (is_object($item)) if (get_class($item) == "stdClass") { if (isset($item->item_name)) { $this->mItemName = $item->item_name; } else { - throw new MWException("Incorrect input format! Missing property \"item_name\" in stdClass."); + throw new MWException(wfMessage('oredictitem-constructor-error')->params('item_name')->text()); } if (isset($item->mod_name)) { $this->mItemMod = $item->mod_name; } else { - throw new MWException("Incorrect input format! Missing property \"mod_name\" in stdClass."); + throw new MWException(wfMessage('oredictitem-constructor-error')->params('mod_name')->text()); } if (isset($item->tag_name)) { $this->mTagName = $item->tag_name; } else { - throw new MWException("Incorrect input format! Missing property \"tag_name\" in stdClass."); + throw new MWException(wfMessage('oredictitem-constructor-error')->params('tag_name')->text()); } if (isset($item->grid_params)) { $this->mItemParams = OreDictHooks::ParseParamString($item->grid_params); } else { - throw new MWException("Incorrect input format! Missing property \"grid_params\" in stdClass."); + throw new MWException(wfMessage('oredictitem-constructor-error')->params('grid_params')->text()); } if (isset($item->entry_id)) { $this->mId = $item->entry_id; } else { - throw new MWException("Incorrect input format! Missing property \"entry_id\" in stdClass."); + throw new MWException(wfMessage('oredictitem-constructor-error')->params('entry_id')->text()); } return 0; } @@ -477,7 +477,7 @@ public function __construct($item, $tag = '', $mod = '', $params = '') { */ public function joinParams($params, $override = false) { - OreDictError::debug("Joining params: $params."); + OreDictError::debug(wfMessage('oredictitem-join-debug')->params($params)); $input = OreDictHooks::ParseParamString($params); foreach ($input as $key => $value) { if (isset($this->mItemParams[$key])) { @@ -571,33 +571,33 @@ public function output() { if (!isset(self::$mDebug)) return ""; $colors = array( - "Log" => "#CEFFFD", - "Warning" => "#FFFFB5", - "Deprecated" => "#CCF", - "Query" => "#D1FFB3", - "Error" => "#FFCECE", - "Notice" => "blue" + "log" => "#CEFFFD", + "warning" => "#FFFFB5", + "deprecated" => "#CCF", + "query" => "#D1FFB3", + "error" => "#FFCECE", + "notice" => "blue" ); $textColors = array( - "Log" => "black", - "Warning" => "black", - "Deprecated" => "black", - "Query" => "black", - "Error" => "black", - "Notice" => "white" + "log" => "black", + "warning" => "black", + "deprecated" => "black", + "query" => "black", + "error" => "black", + "notice" => "white" ); $html = "
Type | Message |
---|---|
" . wfMessage('oredicterror-heading-type')->text() . " | " . wfMessage('oredicterror-heading-msg')->text() . " |
{$message[0]} | {$message[1]} |
" . wfMessage("oredicterror-type-{$message[0]}")->text() . " | {$message[1]} |
Notice | No warnings. |