[open-ils-commits] r13246 - in trunk: Open-ILS/web/js/dojo/openils Open-ILS/web/js/dojo/openils/opac Open-ILS/web/js/dojo/openils/opac/nls Open-ILS/web/opac/skin/default/js build/i18n (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 26 23:48:30 EDT 2009
Author: dbs
Date: 2009-05-26 23:48:28 -0400 (Tue, 26 May 2009)
New Revision: 13246
Added:
trunk/Open-ILS/web/js/dojo/openils/opac/
trunk/Open-ILS/web/js/dojo/openils/opac/nls/
trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
Modified:
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
trunk/build/i18n/Makefile
Log:
Internationalize the MFHD strings in the OPAC, using Dojo
Added: trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js (rev 0)
+++ trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2009-05-27 03:48:28 UTC (rev 13246)
@@ -0,0 +1,14 @@
+{
+ "EDIT_LABEL": "Edit",
+ "HOLDINGS": "Holdings",
+ "INDEXES": "Indexes",
+ "CURRENT_HOLDINGS": "Current holdings",
+ "CURRENT_INDEXES": "Current indexes",
+ "CURRENT_SUPPLEMENTS": "Current supplements",
+ "HOLDINGS_TABLE_CAPTION": "Holdings summary",
+ "INCOMPLETE_VOLUMES": "Incomplete volumes",
+ "MISSING_VOLUMES": "Missing volumes",
+ "ONLINE_VOLUMES": "Online volumes",
+ "SAVE_MFHD_LABEL": "Save MFHD",
+ "SUPPLEMENTS": "Supplements"
+}
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-27 03:45:04 UTC (rev 13245)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-27 03:48:28 UTC (rev 13246)
@@ -27,7 +27,13 @@
var rdetailShowCopyLocation = true;
var googleBookPreview = true;
var displaySerialHoldings = true;
+var opac_strings;
+/* serials are currently the only use of Dojo strings in the OPAC */
+if (displaySerialHoldings) {
+ dojo.requireLocalization("openils.opac", "opac");
+ opac_strings = dojo.i18n.getLocalization("openils.opac", "opac");
+}
var nextContainerIndex;
@@ -192,7 +198,7 @@
win.xulG = {
record : {marc : rec.marc()},
save : {
- label: 'Save MFHD',
+ label: opac_strings.SAVE_MFHD_LABEL,
func: function(xmlString) {
rec.marc(xmlString);
rec.ischanged(true);
@@ -242,21 +248,27 @@
return null;
}
- dojo.place("<table><caption id='mfhdHoldingsCaption' class='rdetail_header color_1'>Holdings summary</caption><tbody id='rdetail_holdings_tbody_" + entryNum + "'></tbody></table>", "rdetail_details_table", "after");
- if (hh.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Holdings', hh); }
- if (hch.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Current holdings', hch); }
- if (hs.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Supplements', hs); }
- if (hcs.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Current supplements', hcs); }
- if (hi.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Indexes', hi); }
- if (hci.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Current indexes', hci); }
- if (ho.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Online', ho); }
- if (hm.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Missing volumes', hm); }
- if (hinc.length > 0) { _holdingsDrawMFHDEntry(entryNum, 'Incomplete volumes', hm); }
+ dojo.place("<table><caption id='mfhdHoldingsCaption' class='rdetail_header color_1'>" +
+ opac_strings.HOLDINGS_TABLE_CAPTION + "</caption><tbody id='rdetail_holdings_tbody_" +
+ entryNum + "'></tbody></table>", "rdetail_details_table", "after"
+ );
+ if (hh.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.HOLDINGS, hh); }
+ if (hch.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.CURRENT_HOLDINGS, hch); }
+ if (hs.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.SUPPLEMENTS, hs); }
+ if (hcs.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.CURRENT_SUPPLEMENTS, hcs); }
+ if (hi.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.INDEXES, hi); }
+ if (hci.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.CURRENT_INDEXES, hci); }
+ if (ho.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.ONLINE_VOLUMES, ho); }
+ if (hm.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.MISSING_VOLUMES, hm); }
+ if (hinc.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.INCOMPLETE_VOLUMES, hm); }
if (isXUL()) {
dojo.require('openils.Event');
dojo.require('openils.PermaCrud');
- dojo.place("<span> - </span><a class='classic_link' href='javascript:loadMarcEditor(" + holdings.id() + ")'> Edit</a>", "mfhdHoldingsCaption", "last");
+ dojo.place("<span> - </span><a class='classic_link' href='javascript:loadMarcEditor(" +
+ holdings.id() + ")'>" + opac_strings.EDIT_LABEL + "</a>",
+ "mfhdHoldingsCaption", "last"
+ );
}
}
Modified: trunk/build/i18n/Makefile
===================================================================
--- trunk/build/i18n/Makefile 2009-05-27 03:45:04 UTC (rev 13245)
+++ trunk/build/i18n/Makefile 2009-05-27 03:48:28 UTC (rev 13246)
@@ -8,6 +8,7 @@
SERVER_PROPSDIR=../../Open-ILS/xul/staff_client/server/locale
DOJO_LOCALE := $(shell echo ${LOCALE} | tr '[:upper:]-' '[:lower:]/')
DOJO_CON_SRC=../../Open-ILS/web/js/dojo/openils/conify/nls
+DOJO_OPAC_SRC=../../Open-ILS/web/js/dojo/openils/opac/nls
DOJO_RPT_SRC=../../Open-ILS/web/js/dojo/openils/reports/nls
FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
FMIDLOUT=fm_IDL.pot
@@ -83,6 +84,7 @@
dojo2pot:
@scripts/dojo_resource.py --pot $(DOJO_CON_SRC)/conify.js --output $(POTSRC)/conify.js.pot
+ @scripts/dojo_resource.py --pot $(DOJO_OPAC_SRC)/opac.js --output $(POTSRC)/opac.js.pot
@scripts/dojo_resource.py --pot $(DOJO_RPT_SRC)/reports.js --output $(POTSRC)/reports.js.pot
po2dojo:
@@ -156,5 +158,7 @@
cp $(POOUTDIR)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)
mkdir -p $(DOJO_CON_SRC)/$(DOJO_LOCALE)
cp $(PROJECT)/$(LOCALE)/conify.js $(DOJO_CON_SRC)/$(DOJO_LOCALE)/conify.js
+ mkdir -p $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)
+ cp $(PROJECT)/$(LOCALE)/opac.js $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)/opac.js
mkdir -p $(DOJO_RPT_SRC)/$(DOJO_LOCALE)
cp $(PROJECT)/$(LOCALE)/reports.js $(DOJO_RPT_SRC)/$(DOJO_LOCALE)/reports.js
More information about the open-ils-commits
mailing list