Permalink
Browse files

Error messages are now translatable. Closes #155.

  • Loading branch information...
jayarjo committed Dec 3, 2010
2 parents d9fd928 + ba00aca commit 37801c7c7fdf686b051635bf6886496c4d7eca19
@@ -236,7 +236,7 @@
if (httpStatus >= 400) {
up.trigger('Error', {
code : plupload.HTTP_ERROR,
- message : 'HTTP Error.',
+ message : plupload.translate('HTTP Error.'),
file : file,
status : httpStatus
});
@@ -245,7 +245,7 @@
} else {
up.trigger('Error', {
code : plupload.GENERIC_ERROR,
- message : 'Generic Error.',
+ message : plupload.translate('Generic Error.'),
file : file,
details : res.error
});
@@ -235,7 +235,7 @@
uploader.bind("Flash:SecurityError", function(up, err) {
uploader.trigger('Error', {
code : plupload.SECURITY_ERROR,
- message : 'Security error.',
+ message : plupload.translate('Security error.'),
details : err.message,
file : uploader.getFile(lookup[err.id])
});
@@ -244,7 +244,7 @@
uploader.bind("Flash:GenericError", function(up, err) {
uploader.trigger('Error', {
code : plupload.GENERIC_ERROR,
- message : 'Generic error.',
+ message : plupload.translate('Generic error.'),
details : err.message,
file : uploader.getFile(lookup[err.id])
});
@@ -253,7 +253,7 @@
uploader.bind("Flash:IOError", function(up, err) {
uploader.trigger('Error', {
code : plupload.IO_ERROR,
- message : 'IO error.',
+ message : plupload.translate('IO error.'),
details : err.message,
file : uploader.getFile(lookup[err.id])
});
@@ -279,7 +279,7 @@
} else {
up.trigger('Error', {
code : plupload.HTTP_ERROR,
- message : 'HTTP Error.',
+ message : plupload.translate('HTTP Error.'),
file : file,
chunk : chunk,
chunks : chunks,
@@ -162,7 +162,7 @@
// Probably a permission denied error
up.trigger('Error', {
code : plupload.SECURITY_ERROR,
- message : 'Security error.',
+ message : plupload.translate('Security error.'),
file : currentFile
});
@@ -380,7 +380,7 @@
if (httpStatus >= 400) {
up.trigger('Error', {
code : plupload.HTTP_ERROR,
- message : 'HTTP Error.',
+ message : plupload.translate('HTTP Error.'),
file : file,
status : httpStatus
});
@@ -755,7 +755,7 @@
if (extensionsRegExp && !extensionsRegExp.test(file.name)) {
up.trigger('Error', {
code : plupload.FILE_EXTENSION_ERROR,
- message : 'File extension error.',
+ message : plupload.translate('File extension error.'),
file : file
});
@@ -766,7 +766,7 @@
if (file.size !== undef && file.size > settings.max_file_size) {
up.trigger('Error', {
code : plupload.FILE_SIZE_ERROR,
- message : 'File size error.',
+ message : plupload.translate('File size error.'),
file : file
});
@@ -893,7 +893,7 @@
// Trigger an init error if we run out of runtimes
self.trigger('Error', {
code : plupload.INIT_ERROR,
- message : 'Init error.'
+ message : plupload.translate('Init error.')
});
}
}
View
@@ -136,7 +136,7 @@
switch (code) {
case plupload.GENERIC_ERROR:
- err.message = 'Generic error.';
+ err.message = plupload.translate('Generic error.');
err.file = file;
break;
@@ -145,19 +145,19 @@
return;
case plupload.IO_ERROR:
- err.message = 'IO error.';
+ err.message = plupload.translate('IO error.');
err.file = file;
break;
case plupload.SECURITY_ERROR:
- err.message = 'Security error.';
+ err.message = plupload.translate('Security error.');
err.file = file;
break;
case 101:
if (file == up.files[1]) {
err.code = plupload.GENERIC_ERROR;
- err.message = 'Generic error.';
+ err.message = plupload.translate('Generic error.');
err.file = file;
} else
return;
@@ -166,7 +166,7 @@
case 102:
if (file == up.files[1] && response.chunk == 1) {
- err.message = 'Fake chunk error.';
+ err.message = plupload.translate('Fake chunk error.');
err.file = file;
} else
return;
@@ -177,8 +177,8 @@
return;
default:
- err.message = 'User specific error.';
- err.details = 'Some custom data.';
+ err.message = plupload.translate('User specific error.');
+ err.details = plupload.translate('Some custom data.');
err.file = file;
}

0 comments on commit 37801c7

Please sign in to comment.