Технические пожелания WMDE/Перемещение файлов на Викисклад/Документация файла конфигурации

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page WMDE Technical Wishes/Move files to Commons/Configuration file documentation and the translation is 35% complete.

Проверки файла и соответствие шаблона с расширением FileImporter

Эта страница вкратце

Когда вы импортирует локальный файл, FileImporter проверяет его шаблоны, а затем обрабатывает файл соответствующим образом, например,

  • импортирование не совершается, если файл имеет лицензию, неподходящую для Викисклада,
  • импортирование не совершается, если у файла отсутствует шаблон, который явно допускает перенос на Викисклад,
  • 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.

Пожалуйста, обратите внимание

  • 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.

В подробностях: Как работает конфигурация страниц?

Any 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.

Что Где
это определено на странице конфигурации
Как это работает Поддерживается ли это?
check categories to block imports Categories: Bad The FileImporter checks if the file contains any of the categories listed under “Bad”.
  • If it does, the transfer to Commons is blocked.
  • If the list is empty, the transfer isn’t blocked for any file.
  • If the section Categories: Bad doesn’t exist in the config page, all imports are blocked to prevent import mistakes.

How to write the block rules in the config page:

* Name of bad category 1
* Name of bad category 2

Green tickY да
check license to allow or block imports Templates: Good The FileImporter checks if the file contains any of the templates listed under “Good”.
  • If not, the transfer to Commons is prevented.
  • If the file has a template which includes a template from this list, the transfer to Commons is allowed.
  • If the list is empty, the transfer is allowed for any file.
  • If the section Templates:Good doesn’t exist in the config page, all imports are blocked to prevent import mistakes.

How to write the good template rules in the config page:

* Name-of-good-template-1
* Name-of-good-template-2

Green tickY да
Templates: Bad The FileImporter checks if the file contains any of the templates listed under “Bad”.
  • If it does, the transfer to Commons is blocked.
  • If the file has a template which includes a template from this list, the transfer to Commons is blocked.
  • If the list is empty, the transfer isn’t blocked for any file.
  • If the section Templates: Bad doesn’t exist in the config page, all imports are blocked to prevent import mistakes.

How to write the bad template rules in the config page:

* Name-of-bad-template-1
* Name-of-bad-template-2

Green tickY да
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}}.
  • If it does, the templates are removed during transfer.

How to write the remove template rules in the config page:

* Name-of-template-to-remove-1
* Name-of-template-to-remove-1

Green tickY да
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:

replacing transfer rule пример вики-текста
шаблон ; LOCAL_TEMPLATE: COMMONS_TEMPLATE ; Bild-CC-by-sa/4.0: Cc-by-sa-4.0
шаблон и его параметры ; LOCAL_TEMPLATE: COMMONS_TEMPLATE | COMMONS_PARAMETER=LOCAL_PARAMETER | … ; Information: Information |Description=Beschreibung | …
If the source template uses unnamed parameters, you must specify the corresponding number on the right side of the “=”. ; OTRS: PermissionOTRS | id=2

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. Пример:

  • исходный код вики-текста: {{Information|Beschreibung=Beispiel}}
  • конфигурация: ;Information:Information|@Description=Beschreibung
  • результат: {{Information|Description={{de|Beispiel}}}}

If a parameter is preceded by an + sign, FileImporter to add this parameter in Commons with the value after "=". Пример:

  • исходный код вики-текста: {{Bild-GFDL-Neu}}
  • конфигурация: ;Bild-GFDL-Neu:GFDL|+migration=not-eligible
  • результат: {{GFDL|migration=not-eligible}}
Green tickY да
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:

* Description:
* Summary

Notice it is possible to add more variants for example with and without a ":"

Green tickY да
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:

* License:
* Licensing

Notice it is possible to add more variants for example with and without a ":"

Green tickY да
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.

Green tickY yes on Wikidata

Не включено

Что Где
это определено на странице конфигурации
Описание Поддерживается ли это?
добавить шаблон {{information}} Information: Template If the file page on the local wiki doesn't contain a template, no {{Information|…}} template is created on Commons. Red XN не запланировано
заменить или убрать категории / In this version, categories are not matched, as this is a very complex thing to do. For now, categories must be replaced manually. Red XN не запланировано