WMDE Technical Wishes/Move files to Commons/Configuration file documentation
File checks and template matching with the FileImporter extension
editIn a nutshell
editWhen you import a local file, the FileImporter checks its templates and then processes the file accordingly, e.g.
- the import is prevented if the file has a license that's not suitable for Wikimedia Commons,
- the import is prevented if the file is missing a template that clearly allows an import to Wikimedia Commons,
- a template is replaced if an equivalent template exists on Wikimedia Commons.
All checks and their resulting actions are described in the table below.
The checks are based on configuration pages. These pages originate from the configuration pages of the Commons2Helper tool.
- Many wikis already have a configuration page.
- Overview of all configuration pages
Please note
edit- Each wiki must have a configuration page. Imports from wikis without a configuration page will be blocked.
- The configuration pages are maintained by the individual wiki communities. If you want to use the FileExporter on your wiki, please check if your wiki's configuration page is set up correctly. The table below explains the function and structure of a configuration page.
- Do not translate the headings to your local language.
In detail: How do the configuration pages work?
editAny changes that are made to these pages come into effect immediately. E.g. if you add a template to the section “Templates:Transfer”, the next export will immediately include a check for this template.
What | Where it's defined in the config page |
How it works | Is it supported? | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
check categories to block imports | Categories: Bad | The FileImporter checks if the file contains any of the categories listed under “Bad”.
How to write the block rules in the config page:
|
yes | |||||||||||
check license to allow or block imports | Templates: Good | The FileImporter checks if the file contains any of the templates listed under “Good”.
How to write the good template rules in the config page:
|
yes | |||||||||||
Templates: Bad | The FileImporter checks if the file contains any of the templates listed under “Bad”.
How to write the bad template rules in the config page:
|
yes | ||||||||||||
remove templates during transfer | Templates: Remove | The FileImporter checks if the file contains any of the templates listed under “Remove”, e.g. {{Move to Commons}}.
How to write the remove template rules in the config page:
|
yes | |||||||||||
replace templates and parameters | Templates: Transfer | The FileImporter replaces the file’s local templates and parameters with the corresponding Commons templates and parameters from the list.
How to write the transfer rules in the config page:
If a parameter is preceded by an @ sign, FileImporter puts the contents of this parameter in language tags of the language the file is from. Example:
If a parameter is preceded by an + sign, FileImporter to add this parameter in Commons with the value after "=". Example:
|
yes | |||||||||||
replace section headings | Information: Description | Replaces the heading of the description section according to the configuration page, e.g. from Beschreibung in German Wikipedia to {{int:filedesc}} on Commons. If the heading of the local file isn’t in the configuration page, no replacements will be made.
How to write the replace description heading rules in the config page:
Notice it is possible to add more variants for example with and without a ":" |
yes | |||||||||||
Information: Licensing | Replaces the heading of the licensing section according to the configuration page, e.g. from اجازهنامه in Farsi Wikipedia to {{int:license-header}} on Commons. If the heading of the local file isn’t in the configuration page, no replacements will be made.
How to write the replace licensing heading rules in the config page:
Notice it is possible to add more variants for example with and without a ":" |
yes | ||||||||||||
mark local file after transfer | Source wiki info (Wikidata) | Once the file is transferred to Commons the file can be tagged with a template to tell that the file i now on Commons. On English Wikipedia the name is en:Template:Now Commons.
This definition is not added on the configuration page. It is done on Wikidata. |
yes on Wikidata |