Index: trunk/extensions/PageInCat/PageInCat.i18n.php |
— | — | @@ -11,18 +11,18 @@ |
12 | 12 | $messages['en'] = array( |
13 | 13 | 'pageincat-desc' => 'Adds a parser function <code><nowiki>{{#incat:...}}</nowiki></code> to determine if the current page is in a specified category', |
14 | 14 | 'pageincat-wrong-warn' => '\'\'\'Warning:\'\'\' The {{PLURAL:$2|category $1 was|categories $1 were}} detected incorrectly by <code><nowiki>{{#incat:...}}</nowiki></code>, and as a result this preview may be incorrect. The saved version of this page should be displayed in the correct manner.', |
15 | | - 'pageincat-very-wrong-warn' => '\'\'\'Warning:\'\'\' The {{PLURAL:$2|category $1 was|categories $1 were}} detected incorrectly by <code><nowiki>{{#incat:...}}</nowiki></code>, and as a result this preview may be incorrect. This can be caused by including categories inside of <code><nowiki>{{#incat:...}}</nowiki></code> statements, and may result in inconsistant display.', |
| 15 | + 'pageincat-very-wrong-warn' => '\'\'\'Warning:\'\'\' The {{PLURAL:$2|category $1 was|categories $1 were}} detected incorrectly by <code><nowiki>{{#incat:...}}</nowiki></code>, and as a result this preview may be incorrect. This can be caused by including categories inside of <code><nowiki>{{#incat:...}}</nowiki></code> statements, and may result in inconsistent display.', |
16 | 16 | ); |
17 | 17 | |
18 | 18 | /** Message documentation (Message documentation) */ |
19 | 19 | $messages['qqq'] = array( |
20 | 20 | 'pageincat-wrong-warn' => 'Warning displayed during preview when editing a page if #incat parser function acted incorrectly (Acting incorrectly means acting as if page was not in category, but page actually is). This can happen during preview, since the categories from the last saved revision are used instead of the categories specified in the page text. Once page is saved, the correct categories should be used. This error can also be caused by conditional category inclusion (<code><nowiki>{{#ifpageincat:Foo||[[category:Foo]]}}</nowiki></code>. See also {{msg-mw|pageincat-very-wrong-warn}}. |
21 | 21 | |
22 | | -*$1 is the list of categories (in a localized comma seperated list with the last two items separated by {{msg-mw|and}}. The individual category names will be italicized). |
| 22 | +*$1 is the list of categories (in a localized comma separated list with the last two items separated by {{msg-mw|and}}. The individual category names will be italicized). |
23 | 23 | *$2 is how many categories', |
24 | 24 | 'pageincat-very-wrong-warn' => 'Warning displayed during preview when editing a page if #incat parser function acted incorrectly (Acting incorrectly means acting as if page was not in category, but page actually is) . This can happen if someone does something like \'\'put this page in category foo only if its not in category foo\'\' or more generally when people include category links inside <code>#incat</code> functions. Compare this to {{msg-mw|pageincat-wrong-warn}}. Generally this error message can happen when support for checking actual categories in the preview is enabled (but the category functions still behave incorrectly), the other error message will be triggered when such support is disabled. |
25 | 25 | |
26 | | -*$1 is the list of categories (in a localized comma seperated list with the last two items separated by {{msg-mw|and}}. The individual category names will be italicized). |
| 26 | +*$1 is the list of categories (in a localized comma separated list with the last two items separated by {{msg-mw|and}}. The individual category names will be italicized). |
27 | 27 | *$2 is how many categories', |
28 | 28 | ); |
29 | 29 | |
Index: trunk/extensions/PageInCat/PageInCat_body.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | public static function render( $parser, $frame, $args ) { |
28 | 28 | $catText = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
29 | 29 | |
30 | | - // Must specify that content varries with what gets inserted in db on save. |
| 30 | + // Must specify that content varies with what gets inserted in db on save. |
31 | 31 | $parser->getOutput()->setFlag( 'vary-revision' ); |
32 | 32 | |
33 | 33 | if ( self::inCat( $parser->getTitle(), $catText, $parser ) ) { |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | | - * Actually chech it in DB. |
| 97 | + * Actually check it in DB. |
98 | 98 | * @param $pageId int page_id of current page (Already verified to not be 0) |
99 | 99 | * @param $catDBkey String the db key of category we're checking. |
100 | 100 | * @return boolean if the current page belongs to the category. |
— | — | @@ -154,6 +154,7 @@ |
155 | 155 | return true; |
156 | 156 | } |
157 | 157 | |
| 158 | + wfProfileIn( __METHOD__ . '-actual' ); |
158 | 159 | $actualCategories = $parser->getOutput()->getCategories(); |
159 | 160 | $wrongCategories = array(); |
160 | 161 | |
— | — | @@ -201,6 +202,7 @@ |
202 | 203 | |
203 | 204 | $parser->getOutput()->addWarning( $msg ); |
204 | 205 | } |
| 206 | + wfProfileOut( __METHOD__ . '-actual' ); |
205 | 207 | |
206 | 208 | return true; |
207 | 209 | } |
— | — | @@ -284,7 +286,7 @@ |
285 | 287 | |
286 | 288 | if ( !isset( self::$categoriesForPreview[$hash] ) ) { |
287 | 289 | # This probably shouldn't happen |
288 | | - wfDebug( __METHOD__ . ' Could not find relavent cat list.' ); |
| 290 | + wfDebug( __METHOD__ . ' Could not find relevant cat list.' ); |
289 | 291 | return true; |
290 | 292 | } |
291 | 293 | |