User:This, that and the other/For the Common Good/Local wiki data
For the Common Good uses local wiki data to allow its intelligent handling of wikitext to be extended to other wikis. The local wiki data for English Wikipedia is built-in, so if you do not plan to use FtCG on wikis other than English Wikipedia, you don't need to worry about this.
This feature is completely separate from language files, which translate the user interface of FtCG and do not affect how it handles wikitext.
Loading data live from the Internet
[edit]This is the best way to use local wiki data, as you will automatically benefit from the latest updates and improvements made to the wikitext handling algorithms. If you choose this option, the local wiki data file you choose (in most cases, no more than 10 KB in size) is fetched from the FtCG website every time you start FtCG.
All the local wiki data files listed at https://atlight.github.io/ftcg/localdata.html are available live within FtCG.
To use live local wiki data, click the "Settings..." button within FtCG, pick "Use live data from the Internet", and choose your wiki from the list. Then click OK.
Live local wiki data was introduced in version 1.1.
Importing a local wiki data file from your computer
[edit]It is possible to import local wiki data into FtCG from a file on your computer. This is useful if you wish to use a local wiki data file not available online, if you prefer not to use the live online data, or if you are crafting your own local wiki data file.
Local wiki data is stored in files with the extension ".wiki". You can obtain one in one of these ways:
- Go to http://atlight.github.io/ftcg/localdata.html for an index of available local wiki data files.
- Ask "file-savvy" users on a particular wiki whether they have crafted their own FtCG data file for their wiki.
- Write your own: it's not too difficult to write a basic local wiki data file, but if you want to do more advanced stuff, you need to know regular expressions.
Note: Each time you make changes to the local wiki data file, you must import it into FtCG again to see the changes.
Writing your own data file
[edit]Before starting, check out meta:CommonsHelper2: you might be able to gain some inspiration. See if your local wiki has a page there; if it does, look in particular at the "Transfer" section near the bottom.
For further inspiration, you can download the data file for English Wikipedia using the link at http://atlight.github.io/ftcg/localdata.html. However, instead of typing over the English file, consider using the template below, in order to see the helpful comments.
When you are sufficiently inspired, copy and paste the sample below into a text file, and save it with the extension ".wiki". Then edit it to suit, following the guidance given in the file. (Lines beginning with #
are ignored by FtCG.)
# For the Common Good # Local wiki data for YOUR WIKI NAME HERE # After modifying this file, you must import it into FtCG again to see the changes. # This should be the web address of your wiki, without ".org" LocalDomain=xyz.wikipedia # If there is a page describing FtCG on your wiki, put its name here # If not, just keep the following value LocalFtcgPage=w:en:WP:FTCG # Three preset categories to appear at the top of the window # If you don't have three, just remove the unneeded ones Category1=Copy to Wikimedia Commons Category2=Copy to Wikimedia Commons (bot-assessed) Category3=Move to Commons Priority Candidates DefaultCategory=3 # The name of the "Category" namespace on your local wiki, without the colon # (since the English name "Category" works on all wikis, you don't need to include # it here - FtCG handles it) CategoryNamespace=Category # The local name for the "now Commons" template, indicating that the local copy of # an image should be deleted after transfer NowCommonsTag=now Commons # The deletion summary used when deleting a file after transfer (option available # to admins only) - link to a relevant deletion policy if possible NowCommonsDeletionSummary=[[WP:CSD#F8|F8]]: Media file available on Commons # Some edit summaries to translate into your wiki's language NowCommonsAddingTagEditSummary=Added {{now Commons}} tag NowCommonsReplacingTagEditSummary=Replaced {{move to Commons}} tag with {{now Commons}} tag # IMPORTANT: All entries from here onwards are treated as regular expressions. # For normal text entry, this should not be a problem, but when using # symbols like ( ) [ ] ? * + | etc., please prefix with a backslash: \( \[ etc. # Local equivalents of the {{information}} template and its parameters # (put the local name SECOND, e.g. Information=Ergojduhd) Information=Information Description=Description Date=Date Source=Source Author=Author Permission=Permission Other_versions=Other_versions # Section headings in use on the local wiki # (put the local name SECOND, e.g. Summary=Quofkokvej) Summary=Summary Licensing=Licensing|License|Permissions # The regular expression used to detect "Copy to Commons" tags # This one is for English Wikipedia CopyToCommonsRegex={{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*}}\n? # If you aren't technically confident, stop here and delete everything from here to the end # (FtCG will still work!) # Potential problems - conditions which may prevent or affect transfer (like deletion templates) # Notes: - Use IfContains= to search for a string of plain text (case-insensitive) # - Use IfRegex= to match against a regex (case-insensitive) # These should be listed in order of importance - most "problematic" first. [PotentialProblem] IfContains={{db- Message=The file appears to be tagged for speedy deletion. [PotentialProblem] IfRegex={{do not (copy|move) to commons Message=The file is tagged with {{do not move to Commons}}. # ... put as many potential problem sections as needed # Replacements to carry out # LookFor is a regular expression; ReplaceWith is a "replacement pattern" # where $n is the nth "capture" of the regex; for help, # visit MSDN or ask User:This, that and the other # %%OriginalUploader%% and # %%InterwikiLinkPrefix%% are special variables supplied by FtCG [Replacement] LookFor={{orphan image.*}}\n? ReplaceWith= [Replacement] LookFor={{Some-Name-In-Another-Language-For-PD-art}} ReplaceWith={{PD-art}} # ... put as many replacement sections as needed # Replacements of self-license tags, like PD-self, GFDL-self # These use the same format as "Replacements" above [SelfLicenseReplacement] LookFor={{PD-self([^\}]*)}} ReplaceWith={{PD-user|%%OriginalUploader%%|en}} [SelfLicenseReplacement] LookFor={{GFDL-self-with-disclaimers([^\}]*)}} ReplaceWith={{GFDL-user-en-with-disclaimers|%%OriginalUploader%%$1}} [SelfLicenseReplacement] LookFor={{GFDL-self([^\}]*)}} ReplaceWith={{GFDL-user|%%OriginalUploader%%|en$1}} [SelfLicenseReplacement] LookFor={{self([^\}]*)}} ReplaceWith={{self$1|author=[[%%InterwikiLinkPrefix%%:%%OriginalUploader%%|]]}} # ... put as many as needed