From 5a8789fdba6ab3664d40f17e4c7e80a1e9e3cbc4 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 7 Jun 2010 05:57:06 +0000 Subject: [PATCH] Stab at matching up reservation.js with the pluralized, JSON-compliant Dojo NLS file git-svn-id: svn://svn.open-ils.org/ILS/trunk@16609 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/booking/reservation.js | 31 ++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/js/ui/default/booking/reservation.js b/Open-ILS/web/js/ui/default/booking/reservation.js index 8e97b22556..08b56b2fe9 100644 --- a/Open-ILS/web/js/ui/default/booking/reservation.js +++ b/Open-ILS/web/js/ui/default/booking/reservation.js @@ -309,12 +309,23 @@ function create_bresv(resource_list) { } } else { var missing; - alert((missing = check_bresv_targeting(results)) ? - localeStrings.CREATE_BRESV_OK_MISSING_TARGET( - results.length, missing - ) : - localeStrings.CREATE_BRESV_OK(results.length) + if (missing = check_bresv_targeting(results)) { + alert(dojo.string.substitute( + localeStrings.CREATE_BRESV_OK_MISSING_TARGET, + [results.length, missing] + )); + } else { + if (results.length == 1) { + alert(dojo.string.substitute( + localeStrings.CREATE_BRESV_OK(results.length) + )); + } else { + alert(dojo.string.substitute( + localeStrings.CREATE_BRESV_OK_PLURAL(results.length) + )); + } ); + } update_brsrc_list(); update_bresv_grid(); } @@ -448,7 +459,15 @@ function cancel_reservations(bresv_id_list) { } else if (is_ils_event(result)) { alert(my_ils_error(localeStrings.CXL_BRESV_FAILURE2, result)); } else { - alert(localeStrings.CXL_BRESV_SUCCESS(result.length)); + if (result.length == 1) { + alert(dojo.string.substitute( + localeStrings.CXL_BRESV_SUCCESS, [result.length] + )); + } else { + alert(dojo.string.substitute( + localeStrings.CXL_BRESV_SUCCESS_PLURAL, [result.length] + )); + } } } -- 2.11.0