Use short license name from template if we don't recognize it

We have been saying 'view terms' for every non-CC/PD image, which
is not particularly helpful.

Change-Id: Ia5fc6fb3af3802ad8a1f5188226fe4e89ab6d8d9
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/472
This commit is contained in:
Gergő Tisza 2014-04-19 00:26:55 +00:00
parent c1b2b1bb2c
commit 4e081a9559

View file

@ -546,15 +546,10 @@
* @param {string} filePageUrl URL of the file description page
*/
MPP.setLicense = function ( license, filePageUrl ) {
var message, shortName, url, isCc;
var shortName, url, isCc;
if ( license ) {
message = 'multimediaviewer-license-' + ( license.internalName || '' );
if ( mw.messages.exists( message ) ) {
shortName = mw.message( message ).text();
} else {
shortName = mw.message( 'multimediaviewer-license-default' ).text();
}
shortName = license.getShortName();
url = license.deedUrl || filePageUrl;
isCc = license.isCc();
} else {