Jump to content

User:Saroj/CatSync

From Meta, a Wikimedia project coordination wiki

CatSync is a gadget that lets you copy categories from a matching article on another Wikimedia project into the current article, matched via Wikidata sitelinks.

The script adds a "Sync categories" button to the page actions menu. Selecting a source project and language fetches that article's categories, matches each one to its Wikidata item, and checks whether an equivalent category exists on the current wiki. You then get a preview of the new categories with checkboxes, so you can review and select exactly which ones to insert before saving.

CatSync only runs on Wikipedia and Wikiquote articles; it will not appear on other projects. The source project defaults to Wikipedia, since it generally has the most complete categorization.

Import

[edit]

To import CatSync, add the following JavaScript to your global.js:

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Saroj/CatSync.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Saroj/CatSync.js]]

Usage

[edit]
  1. Open any mainspace article on Wikipedia or Wikiquote.
  2. Click Sync categories in the page actions menu.
  3. Choose the source project and language (defaults to Wikipedia, English).
  4. Click Sync to fetch and match categories.
  5. In the preview, review the categories found and uncheck any you don't want.
  6. Click Insert to add the selected categories to the article.