r80736 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80735‎ | r80736 | r80737 >
Date:00:12, 22 January 2011
Author:vyznev
Status:ok (Comments)
Tags:
Comment:
Add extension and MIME type as parameters to filetype-mime-mismatch message. Also fix an ungrammatical Finnish translation of filetype-badmime while I'm at it.
Modified paths:
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFi.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadBase.php
@@ -312,7 +312,7 @@
313313
314314 # XXX: Missing extension will be caught by validateName() via getTitle()
315315 if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
316 - return array( 'filetype-mime-mismatch' );
 316+ return array( 'filetype-mime-mismatch', $this->mFinalExtension, $mime );
317317 }
318318
319319 # Check IE type
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2109,7 +2109,7 @@
21102110 'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles.
21112111 Please rename the file and try uploading it again.',
21122112 'badfilename' => 'File name has been changed to "$1".',
2113 -'filetype-mime-mismatch' => 'File extension does not match MIME type.',
 2113+'filetype-mime-mismatch' => 'File extension ".$1" does not match the detected MIME type of the file ($2).',
21142114 'filetype-badmime' => 'Files of the MIME type "$1" are not allowed to be uploaded.',
21152115 'filetype-bad-ie-mime' => 'Cannot upload this file because Internet Explorer would detect it as "$1", which is a disallowed and potentially dangerous file type.',
21162116 'filetype-unwanted-type' => "'''\".\$1\"''' is an unwanted file type.
Index: trunk/phase3/languages/messages/MessagesFi.php
@@ -1613,8 +1613,8 @@
16141614 'minlength1' => 'Tiedoston nimessä pitää olla vähintään yksi merkki.',
16151615 'illegalfilename' => "Tiedoston nimessä '''$1''' on merkkejä, joita ei sallita sivujen nimissä. Vaihda tiedoston nimeä, ja yritä lähettämistä uudelleen.",
16161616 'badfilename' => 'Tiedoston nimi vaihdettiin: $1.',
1617 -'filetype-mime-mismatch' => 'Tiedostopääte ei vastaa MIME-tyyppiä.',
1618 -'filetype-badmime' => 'Tiedostot, joiden MIME-tyyppi on <tt>$1</tt> ei voi lähettää.',
 1617+'filetype-mime-mismatch' => 'Tiedostopääte <tt>.$1</tt> ei vastaa tiedoston tyyppiä (<tt>$2</tt>).',
 1618+'filetype-badmime' => '<tt>$1</tt> -tyypisten tiedostojen tallennus on kielletty.',
16191619 'filetype-bad-ie-mime' => 'Tiedostoa ei voi tallentaa, koska Internet Explorer tunnistaa sen kielletyksi tiedostomuodoksi $1, joka on mahdollisesti vaarallinen.',
16201620 'filetype-unwanted-type' => "'''.$1''' ei ole toivottu tiedostomuoto. {{PLURAL:$3|Suositeltu tiedostomuoto on|Suositeltuja tiedostomuotoja ovat}} $2.",
16211621 'filetype-banned-type' => "'''.$1''' ei ole sallittu tiedostomuoto. {{PLURAL:$3|Sallittu tiedostomuoto on|Sallittuja tiedostomuotoja ovat}} $2.",

Comments

#Comment by Bryan (talk | contribs)   14:11, 2 February 2011

Why is $1 in quotes and $2 in parentheses? I'd rather use one consistent style.

#Comment by Ilmari Karonen (talk | contribs)   21:41, 2 February 2011

Because $1 is a quote from the file name, while $2 is supposed to be a description of the file type (even if, in practice, MIME types are not particularly readable descriptions to most user). And yes, fixing it so that the MIME type was replaced by a human-readable description of the file type (where known) would be welcome.

#Comment by Bryan (talk | contribs)   22:10, 2 February 2011

Ok

Status & tagging log