In T232481: Investigate options to mark file imports with their source wiki, make searchable we discovered that searching for recent imports from a given source wiki is a difficult task. Let's solve by providing a means to mark imports with a category specific to the source wiki, for example "Imported from English Wikipedia". This category assignment should be highly customizable by the community.
Acceptance criteria:
- Add a custom message which will be substituted into imported file info. This message should default to empty.
- The message will take two parameters, the full URL of the source file and the import timestamp.
- Must play well with messages that {{subst:...}}
- Update documentation to explain how this message can be used, with example message and module source.
Open questions:
- Would the community prefer natural-language site names as part of the category, like "English Wikipedia"? If so, is there already a module providing the mapping from fully-qualified hostname to natural-language display name? We might offer to write this module if it doesn't exist. There's already Module:Interwiki and tools based on it.
- We'll probably include a default message with something like the text which is currently hardcoded: "<!--This file was moved here using FileImporter from $1-->\n". This message is always used in the content language, so for Wikimedia Commons wouldn't require translation. Should we add a note discouraging translation? Or is it useful to hypothetical, 3rd-party wiki families using this extension with a different content language? Should we bundle an empty message for this reason?
- If file info text exists or has been customized, and if no template fixups will be made (TODO: this is strange), we skip annotating with our message. This seems wrong. Should we prepend the message on entering the import workflow, then let the user edit file info even including removing the message?
- If we include the import annotation in the file info preview, and it transcludes automatic categories, then it will break our "no categories" detection.