[open-ils-commits] r19262 - in trunk/Open-ILS/web: js/dojo/openils/opac/nls opac/skin/default/js opac/skin/default/xml/result (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Jan 23 13:43:26 EST 2011


Author: dbs
Date: 2011-01-23 13:43:22 -0500 (Sun, 23 Jan 2011)
New Revision: 19262

Modified:
   trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
   trunk/Open-ILS/web/opac/skin/default/js/myopac.js
   trunk/Open-ILS/web/opac/skin/default/js/result_common.js
   trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Log:
i18n support for a few OPAC strings

Enable translation of the "More copies listed in full record details"
message for the search results library / call number / item /status
lines

Also provide translation support for the hold queue status message,
including singular / plural variants (most languages do not provide
the equivalent of the "item(s)" idiom in English).

Instead of burying the display of hold queue status with a hard
coded "if (false)" test, turn it into a top-level variable for
a bit more exposure.


Modified: trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js	2011-01-23 00:05:18 UTC (rev 19261)
+++ trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js	2011-01-23 18:43:22 UTC (rev 19262)
@@ -34,5 +34,8 @@
 	"SUPPLEMENT_HOLDINGS": "Supplements",
 	"SUPPLEMENT_HOLDINGS_ADD": "Additional Supplement Information",
     "PLACE_HOLD": "Place hold",
-    "MORE": "More"
+    "HOLD_STATUS_PLURAL": "hold # ${0} of ${1} total holds and ${2} potential items",
+    "HOLD_STATUS_SINGULAR": "hold # ${0} of ${1} total holds and ${2} potential item",
+    "MORE": "More",
+    "MORE_COPIES_FULL_RECORD": "... more copies listed in full record"
 }

Modified: trunk/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/myopac.js	2011-01-23 00:05:18 UTC (rev 19261)
+++ trunk/Open-ILS/web/opac/skin/default/js/myopac.js	2011-01-23 18:43:22 UTC (rev 19262)
@@ -3,15 +3,18 @@
 //attachEvt("common", "loggedIn", myOPACInit );
 attachEvt('common','locationUpdated', myopacReload );
 
+dojo.requireLocalization("openils.opac", "opac");
+
+var opac_strings = dojo.i18n.getLocalization("openils.opac", "opac");
 var fleshedUser = null;
 var fleshedContainers = {};
 var holdCache = {};
 var holdStatusCache = {};
+var showHoldQueuePosition = false;
 var allowPendingAddr = false;
 var myopacEnableRefWorks = false;
 var myopacRefWorksHost = 'http://www.refworks.com';
 
-
 function clearNodes( node, keepArray ) {
 	if(!node) return;
 	for( var n in keepArray ) node.removeChild(keepArray[n]);
@@ -472,10 +475,13 @@
 		hideMe($n(row, 'myopac_holds_cancel_link'));
 	}
 
-    if(false) {
+    if (showHoldQueuePosition) {
         var node = $n(row, 'hold_qstats');
-        // XXX best way to display this info + dojo i18n
-        node.appendChild(text('hold #' + qstats.queue_position+' of '+qstats.queue_position+' and '+qstats.potential_copies+' item(s)'));
+        if (qstats.potential_copies == 1) {
+            node.appendChild(text(dojo.string.substitute(opac_strings.HOLD_STATUS_SINGULAR, [qstats.queue_position, qstats.total_holds, qstats.potential_copies])));
+        } else {
+            node.appendChild(text(dojo.string.substitute(opac_strings.HOLD_STATUS_PLURAL, [qstats.queue_position, qstats.total_holds, qstats.potential_copies])));
+        }
         unHideMe(node);
 
     } else {

Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2011-01-23 00:05:18 UTC (rev 19261)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js	2011-01-23 18:43:22 UTC (rev 19262)
@@ -1,4 +1,6 @@
 dojo.require('openils.BibTemplate');
+dojo.requireLocalization("openils.opac", "opac");
+var opac_strings = dojo.i18n.getLocalization("openils.opac", "opac");
 
 var recordsHandled = 0;
 var recordsCache = [];

Modified: trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml	2011-01-23 00:05:18 UTC (rev 19261)
+++ trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml	2011-01-23 18:43:22 UTC (rev 19262)
@@ -193,7 +193,7 @@
 											item_cnt++;
 											if (item_cnt >= max_items) {
 												dojo.create('br', null, cp_entry);
-												cp_entry.appendChild(dojo.doc.createTextNode('... more print items listed in full record'));
+												cp_entry.appendChild(dojo.doc.createTextNode(opac_strings.MORE_COPIES_FULL_RECORD));
 											}
 											output.appendChild(cp_entry);
 										});



More information about the open-ils-commits mailing list