From c4a30930112e9ab14678fe96f21741f1832c20f7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 14 Jul 2009 12:36:57 -0700 Subject: 3rd attempt to fix localization messages. Last time around I didn't dig deep enough, but now we form the complete message using t() style semantics to replace % placeholders with __ style JS placeholders. Also, stop appending the (completed) text to existing messages.. roll it together. --- modules/gallery/views/simple_uploader.html.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 06a2eaff..38ac518c 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -32,8 +32,9 @@

- - + + + " onclick="swfu.cancelQueue();">

@@ -181,10 +182,7 @@ function file_dialog_complete(num_files_selected, num_files_queued) { if (num_files_selected > 0) { $("#gUploadCancel").show(); - var stats = this.getStats(); - $("#gUploadQueueInfo").text("( " + stats.successful_uploads + - " " + (stats.files_queued + stats.successful_uploads + - stats.upload_errors + stats.upload_cancelled + stats.queue_errors) + ")"); + $("#gUploadQueueInfo").text(get_completed_status_msg(this.getStats())); } // Auto start the upload @@ -255,16 +253,20 @@ function upload_complete(file) { var stats = this.getStats(); - var msg = "()"; - msg = msg.replace("__COMPLETED__", stats.successful_uploads); - msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads + - stats.upload_errors + stats.upload_cancelled + stats.queue_errors); - $("#gUploadQueueInfo").text(msg); + $("#gUploadQueueInfo").text(get_completed_status_msg(stats)); if (stats.files_queued === 0) { $("#gUploadCancel").hide(); } } + function get_completed_status_msg(stats) { + var msg = " "__COMPLETED__", "total" => "__TOTAL__")) ?>"; + msg = msg.replace("__COMPLETED__", stats.successful_uploads); + msg = msg.replace("__TOTAL__", stats.files_queued + stats.successful_uploads + + stats.upload_errors + stats.upload_cancelled + stats.queue_errors); + return msg; + } + // This event comes from the Queue Plugin function queue_complete(num_files_uploaded) { var status_msg = ""; -- cgit v1.2.3