[open-ils-commits] r19270 - in branches/rel_2_0/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
Mon Jan 24 16:22:12 EST 2011
Author: dbs
Date: 2011-01-24 16:22:06 -0500 (Mon, 24 Jan 2011)
New Revision: 19270
Modified:
branches/rel_2_0/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
branches/rel_2_0/Open-ILS/web/opac/skin/default/js/myopac.js
branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js
branches/rel_2_0/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: branches/rel_2_0/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2011-01-24 21:05:04 UTC (rev 19269)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2011-01-24 21:22:06 UTC (rev 19270)
@@ -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: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/myopac.js 2011-01-24 21:05:04 UTC (rev 19269)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/myopac.js 2011-01-24 21:22:06 UTC (rev 19270)
@@ -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: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js 2011-01-24 21:05:04 UTC (rev 19269)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js 2011-01-24 21:22:06 UTC (rev 19270)
@@ -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: branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2011-01-24 21:05:04 UTC (rev 19269)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2011-01-24 21:22:06 UTC (rev 19270)
@@ -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