Index: trunk/extensions/UploadLocal/UploadLocal.i18n.php |
— | — | @@ -42,5 +42,16 @@ |
43 | 43 | ' descriptions, make sure you give a few linebreaks before/after'. |
44 | 44 | ' the text.', |
45 | 45 | |
| 46 | + 'uploadlocal_error_exists' => 'The file $1 already exists', |
| 47 | + 'uploadlocal_error_empty' => 'The file you submitted was empty', |
| 48 | + 'uploadlocal_error_missing' => 'The file is missing an extension', |
| 49 | + 'uploadlocal_error_badtype' => 'This type of file is banned', |
| 50 | + 'uploadlocal_error_tooshort' => 'The filename is too short', |
| 51 | + 'uploadlocal_error_illegal' => 'The filename is not allowed', |
| 52 | + 'uploadlocal_error_overwrite' => 'Overwriting an existing file is not allowed', |
| 53 | + 'uploadlocal_error_verify' => 'This file did not pass file verification: $1', |
| 54 | + 'uploadlocal_error_hook' => 'The modification you tried to make was aborted by an extension hook', |
| 55 | + 'uploadlocal_error_unknown' => 'An unknown error occurred', |
| 56 | + |
46 | 57 | 'right-uploadlocal' => 'Upload files from the local machine' |
47 | 58 | ); |
Index: trunk/extensions/UploadLocal/UploadLocalForm.php |
— | — | @@ -37,11 +37,11 @@ |
38 | 38 | # Check for warnings like the file already exists in the wiki |
39 | 39 | $warnings = $this->upload->checkWarnings(); |
40 | 40 | if ( $warnings && isset( $warnings['exists'] ) && $warnings['exists']['warning'] != 'was-deleted' ) { |
41 | | - $this->uploadError( 'The file '.$warnings['exists']['file']->getName().' already exists' ); |
| 41 | + $this->uploadError( wfMsg( 'uploadlocal_error_exists', $warnings['exists']['file']->getName() ) ); |
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | | - # Check for verificatoins that the upload succeded. |
| 45 | + # Check for verifications that the upload succeded. |
46 | 46 | $verification = $this->upload->verifyUpload(); |
47 | 47 | if ( $verification['status'] === UploadBase::OK ) { |
48 | 48 | $this->upload->performUpload( $this->comment, $this->comment, $this->watch, $user ); |
— | — | @@ -51,32 +51,32 @@ |
52 | 52 | } else { |
53 | 53 | switch( $verification['status'] ) { |
54 | 54 | case UploadBase::EMPTY_FILE: |
55 | | - $this->uploadError( 'The file you submitted was empty' ); |
| 55 | + $this->uploadError( wfMsg( 'uploadlocal_error_empty' ) ); |
56 | 56 | break; |
57 | 57 | case UploadBase::FILETYPE_MISSING: |
58 | | - $this->uploadError( 'The file is missing an extension' ); |
| 58 | + $this->uploadError( wfMsg( 'uploadlocal_error_missing' ) ); |
59 | 59 | break; |
60 | 60 | case UploadBase::FILETYPE_BADTYPE: |
61 | 61 | global $wgFileExtensions; |
62 | | - $this->uploadError( 'This type of file is banned' ); |
| 62 | + $this->uploadError( wfMsg( 'uploadlocal_error_badtype' ) ); |
63 | 63 | break; |
64 | 64 | case UploadBase::MIN_LENGTH_PARTNAME: |
65 | | - $this->uploadError( 'The filename is too short' ); |
| 65 | + $this->uploadError( wfMsg( 'uploadlocal_error_tooshort' ) ); |
66 | 66 | break; |
67 | 67 | case UploadBase::ILLEGAL_FILENAME: |
68 | | - $this->uploadError( 'The filename is not allowed' ); |
| 68 | + $this->uploadError( wfMsg( 'uploadlocal_error_illegal' ) ); |
69 | 69 | break; |
70 | 70 | case UploadBase::OVERWRITE_EXISTING_FILE: |
71 | | - $this->uploadError( 'Overwriting an existing file is not allowed' ); |
| 71 | + $this->uploadError( wfMsg( 'uploadlocal_error_overwrite' ) ); |
72 | 72 | break; |
73 | 73 | case UploadBase::VERIFICATION_ERROR: |
74 | | - $this->uploadError( 'This file did not pass file verification: ' . $verification['details'][0] ); |
| 74 | + $this->uploadError( wfMsg( 'uploadlocal_error_verify', $verification['details'][0] ) ); |
75 | 75 | break; |
76 | 76 | case UploadBase::HOOK_ABORTED: |
77 | | - $this->uploadError( "The modification you tried to make was aborted by an extension hook" ); |
| 77 | + $this->uploadError( wfMsg( 'uploadlocal_error_hook' ) ); |
78 | 78 | break; |
79 | 79 | default: |
80 | | - $this->uploadError( 'An unknown error occurred' ); |
| 80 | + $this->uploadError( wfMsg( 'uploadlocal_error_unknown' ) ); |
81 | 81 | break; |
82 | 82 | } |
83 | 83 | } |