מדיה ויקי:Gadget-HotCat.js: הבדלים בין גרסאות בדף
מ Fix cat_key |
מ Minor fix in auto-localization |
||
| שורה 30: | שורה 30: | ||
// Wikipedia, set it to hotcat_cnames_regexp="[Cc]ategory|分类|分類"; | // Wikipedia, set it to hotcat_cnames_regexp="[Cc]ategory|分类|分類"; | ||
var hotcat_cnames_regexp="[Cc]ategory"; | var hotcat_cnames_regexp="[Cc]ategory"; | ||
// The following is used for inserting new categories. | // The following is used for inserting new categories. Also localized automatically from | ||
// MW 1.16 on. When a category is replaced, the namespace prefix of the removed category | |||
// is used for the newly added category. | |||
var hotcat_canonical="Category"; | var hotcat_canonical="Category"; | ||
// The following should be the same as [[MediaWiki:Categories]]. Localize manually. | // The following should be the same as [[MediaWiki:Categories]]. Localize manually. | ||
| שורה 166: | שורה 167: | ||
hotcat_canonical = wgFormattedNamespaces['14']; | hotcat_canonical = wgFormattedNamespaces['14']; | ||
hotcat_cnames_regexp = create_regexp_str (hotcat_canonical); | hotcat_cnames_regexp += '|' + create_regexp_str (hotcat_canonical); | ||
for (var cat_name in wgNamespaceIds) { | for (var cat_name in wgNamespaceIds) { | ||
if ( typeof (cat_name) | if ( typeof (cat_name) == 'string' | ||
&& cat_name.toLowerCase () != hotcat_canonical.toLowerCase () | |||
&& wgNamespaceIds[cat_name] == 14) | |||
{ | { | ||
hotcat_cnames_regexp += '|' + create_regexp_str (cat_name); | |||
} | } | ||
} | } | ||
} | } | ||