Stab at matching up reservation.js with the pluralized, JSON-compliant Dojo NLS file
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Jun 2010 05:57:06 +0000 (05:57 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Jun 2010 05:57:06 +0000 (05:57 +0000)
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

index 8e97b22..08b56b2 100644 (file)
@@ -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]
+            ));
+        }
     }
 }