מדיה ויקי: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. Localize manually. When a category is
// The following is used for inserting new categories. Also localized automatically from
// replaced, the namespace prefix of the removed category is used for the newly added category.
// 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) != 'string'
       if (  typeof (cat_name) == 'string'
           || cat_name.toLowerCase () == hotcat_canonical.toLowerCase ()
           && cat_name.toLowerCase () != hotcat_canonical.toLowerCase ()
           || wgNamespaceIds[cat_name] != 14)
           && wgNamespaceIds[cat_name] == 14)
       {
       {
         continue;
         hotcat_cnames_regexp += '|' + create_regexp_str (cat_name);
       }
       }
      hotcat_cnames_regexp += '|' + create_regexp_str (cat_name);
     }
     }
   }
   }