Last modified: 2010-03-11 20:14:39 UTC
In SF_Templates.php function getCategoryDefinedByTemplate(...) looks for (least) category entry in each template body to show this as "defined category". Doing this a regex is used: '/\[\[Category:([\w ]*)/' So a potentially localized namespace name (in German "Kategorie:") cannot be found, only canonical "Category:"! A solution might be: In function getCategoryDefinedByTemplate(...): 1. use of MediaWiki global variable $wgContLang 2. replacement of the regexp with: '/\[\[(Category|'.$wgContLang->getNsText(14).'):([\w ]*)/'
Use of option \w leads to the situation, that special characters in category names (e.g. ä, ö, ü, Ä, Ö, Ü, ß for Germans) -- that standard MediaWiki can handle -- "cut off" themselves and the rest of category name. So for a Category:Mühle parser only will find Category:M Seems to be better use of '/\[\[(Category|'.$wgContLang->getNsText(14).'):.+\]\])/' so at least one following character after ":", and cut off "]]" after this. So special characters could be accepted.
Thanks for the fix! This was added in SF version 1.8.8.
To my sorrow you have implemented ONLY the localized form of category "name". In my suggestion there was '... '/\[\[(Category|'.$wgContLang->getNsText(14).'):.+\]\])/' instead of "/\[\[$cat_ns_name:(.*)\]\]/" to assure that BOTH the standard English version AND the localized version $wgContLang->getNsText(14) can work.
Should be "/\[\[($cat_ns_name|Category):(.*)\]\]/"
But what if namespace aliases exist?
NS alias for "Category"? If so - it would fail, but who does such things? But localized NS names are standard...
(In reply to comment #6) > If so - it would fail, but who does such things? zhwiki does (though this will not be used there). "Category" is the localized name there; "分类" and "分類" are aliases (in zh-hans and zh-hant).
Sorry - should have just copied your code in exactly the first time. It's now there, correctly, in v. 1.9. It still doesn't support category aliases, but I'm setting this to "FIXED" anyway.