PreloadFileDescription

PreloadFileDescription is a script that allows you to specify custom text (ex. template code) that will be preloaded when uploading files via:
 * Special:Upload
 * Special:MultipleUpload
 * Upload Photo modals

It also has few other useful features:
 * Support for multiple custom text templates selectable via a dropdown menu (like licenses)
 * Ability to select specific license as default

Instalation
This script can support a single preloaded text template without a dropdown menu or multiple templates. Regardless of the mode you need to import the script:

Remember to specify configuration above.

Single template
You can specify text to preload as a value of  variable. Use  to add line-break in the code.

Multiple templates
If you want to add ability to select the text that is preloaded from few different options that use different template or have additional categories.

In this case  is a list that contains objects with template properties or strings that will generate group names inside the dropdown menu.

The first template on the list will be preloaded at the start.

Configuration
There are few additional variables that allow to modify behavior.


 *   – by default script will display messages in language user has set (and fallback to English if it's not present – More in section: ). You can force script to display text in specific language by providing a language code. Example:
 *   – override messages with custom content – More in section: . Example:
 *   – you can specify license template to be selected by default. Put template name (first part of the entry from Mediawiki:License) as a value. (case sensitive) Example:
 *   – when set to  script will disable file upload until proper (non-empty) license is specified. Example:
 *   – when set to  script will display a short notice when using media uploader from inside the editor (right rail). Example:

Template entry object
The object with info about the template also has two optional properties:
 *   – allows you to specify alternative version of the same template. It'll add two buttons below the description area that allow to switch between the two. Using this method rather than specifying a different template is good for keeping the list compact and having more options. Taking Polish League of Legends Wiki as an example: some templates have an alternative version which include code that automatically fills some parameters if the file has a proper name – allowing uploading multiple files without the need to fill the description separately. (long story short: I needed it so I implemented it ^^)
 *   – script will automatically select specified license when this template is selected (and revert to previously selected one when changed back)

Example code with all properties specified:

i18n
This script doesn't have that much messages, but still if you would like for it to support your language drop a translated code below on the |talk page (or add it to the code if you're confident you won't break it ;)). Thanks You can also add a language, override all or some of the messages locally by specifying them in the  variable.