Page MenuHomePhabricator

custom license: wrong link to Copyright_tags
Closed, ResolvedPublic

Description

Author: saibotrash

Description:
"Die Lizenz wird mit folgendem Wikitext beschrieben (muss eine gültige Lizenzangabe enthalten)" links to [[:commons:Commons:Copyright_tags]] instead of [[:commons:Commons:Lizenzvorlagen]].


Version: unspecified
Severity: minor

Details

Reference
bz33544

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:59 PM
bzimport set Reference to bz33544.

Yeah, what's the best way to find out where such a link is stored?

sumanah wrote:

Santhosh verified that this bug is "easy" and suitable for a new MediaWiki
developer.

mike wrote:

The git repo is here: https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UploadWizard.git
The URL is in UploadWizard.config.php, line 255.

I'm new to Wikimedia (but I'm an experienced software developer). Does the Wikimedia website provide any sort of way to have a single URL that goes to the language-appropriate web page? E.g. with google.com you can append "?hl=en" or "?hl=fr" to have it display in English or French; and of course on Wikipedia itself, XX.wikipedia.org will go to the home page for language "XX".

Is there some similar way to jump to the appropriate for the [[:commons:Commons:Copyright_tags]] page?

Although this was logged as a bug with the German version, this obviously isn't a German-only issue. At the top of the Copyright_tags page, there is already a long list of "this project page in other languages"; the right fix, if any, would probably be to automatically go to the language-appropriate page for any language, not just German.

There's a standard ?uselang parameter, but this will only affect the menu language, not the content language, e.g.:
https://commons.wikimedia.org/wiki/Commons:Copyright_tags?uselang=de

For pages translated with the Translate extension, there's also the convenient Special:MyLanguage redirector, e.g.:
https://meta.wikimedia.org/wiki/Special:MyLanguage/Terms_of_use (will evaluate whatever language setting is in your UI)

Neither is particularly helpful here, and the current hardcoding of license URLs in UploadWizard.config.php probably has to stop. I'd suggest the following implementation strategy:

  • Instead of using an absolute URL attribute for Upload Wizard config variables, use a URL stored in a MediaWiki: user interface message, e.g. "MediaWiki:Mwe-upwiz-license-cc-by-2.5-url". This means we can use the existing convenience functions to retrieve 1) the URL for the current user interface language if defined, 2) fall back to English if not defined.
  • Instead of hardcoding the URLs, we can now simply look up the message defined in the licenses array in UploadWizard.config.php with the added '-url' suffix to try to find a valid URL in the user's language. This is similar to existing MediaWiki messages like "MediaWiki:Portal-url".
  • For bonus points, interpret a -url UI message that follows no valid URI scheme as a MediaWiki title and generate the valid URL. So If I put "Commons:Copyright tags" in "MediaWiki:Mwe-upwiz-license-custom-url", it should automatically turn that into https://commons.wikimedia.org/wiki/Commons:Copyright_tags .

In the above example, defining "MediaWiki:Mwe-upwiz-license-custom-url/de" as "Commons:Lizenzvorlagen" on Commons, or localizing it through the i18n file, would achieve the desired effect.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:25 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:21 AM