From cd6ab2931325323cb59961c4327a18d934ecc72a Mon Sep 17 00:00:00 2001
From: Pellaeon Lin <nfsmwlin@gmail.com>
Date: Thu, 16 Jan 2014 17:51:00 +0800
Subject: [PATCH] Use t() 's native method

---
 apps/files/js/file-upload.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 1a36a58053..a003e5eec8 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -236,13 +236,19 @@ $(document).ready(function() {
 				// check PHP upload limit
 				if (selection.totalBytes > $('#upload_limit').val()) {
 					data.textStatus = 'sizeexceedlimit';
-					data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}').replace('{size1}', humanFileSize(selection.totalBytes)).replace('{size2}', humanFileSize($('#upload_limit').val()));
+					data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}', {
+						'size1': humanFileSize(selection.totalBytes),
+						'size2': humanFileSize($('#upload_limit').val())
+					});
 				}
 
 				// check free space
 				if (selection.totalBytes > $('#free_space').val()) {
 					data.textStatus = 'notenoughspace';
-					data.errorThrown = t('files', 'Not enough free space, you are uploading {size1} but only {size2} is left').replace('{size1}', humanFileSize(selection.totalBytes)).replace('{size2}', humanFileSize($('#free_space').val()));
+					data.errorThrown = t('files', 'Not enough free space, you are uploading {size1} but only {size2} is left', {
+						'{size1}': humanFileSize(selection.totalBytes),
+						'{size2}': humanFileSize($('#free_space').val())
+					});
 				}
 			
 				// end upload for whole selection on error
-- 
GitLab