[open-ils-commits] r19280 - in branches/rel_2_0/Open-ILS/xul/staff_client/server: locale/en-US serial (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jan 25 00:21:04 EST 2011
Author: dbs
Date: 2011-01-25 00:21:01 -0500 (Tue, 25 Jan 2011)
New Revision: 19280
Modified:
branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties
branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/editor_base.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_dists.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_subs.js
Log:
Replace a few hardcoded strings in the serials JavaScript
There is, unfortunately, an awful lot of this left to fix.
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties 2011-01-25 04:44:39 UTC (rev 19279)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties 2011-01-25 05:21:01 UTC (rev 19280)
@@ -100,3 +100,24 @@
pattern_wizard.chronology.m=Alternative numbering scheme
pattern_wizard.not_removable_row=You cannot remove this row because it's not at the end of the sequence. Remove later rows first.
pattern_wizard.bad_date_value=That is not a valid day for that month.
+serial.editor_base.unset=<Unset>
+serail.manage_dists.streams=Streams
+serial.manage_dists.stream_num=Stream : # %1$s
+serial.manage_dists.sbsum=Basic Summary
+serial.manage_dists.sssum=Supplement Summary
+serial.manage_dists.sisum=Index Summary
+serial.manage_dists.library_label=%1$s : %2$s
+serial.manage_dists.distributions=Distributions
+serial.common.default=Default
+serial.manage_subs.predict.alert=You must select a subscription before predicting issuances.
+serial.manage_subs.predict.prompt=How many items (per active pattern) would you like to predict?
+serial.manage_subs.predict.prompt.text=Number of Predicted Items
+serial.manage_subs.invalid_number=Invalid number entered!
+serial.manage_subs.predict_success=Successfully predicted %1$s issuance(s) for subscription # %2$s.
+serial.manage_subs.distributions=Distributions
+serial.manage_subs.issuances=Issuances
+serial.manage_subs.captions_patterns=Captions/Patterns
+serial.manage_subs.tree_location=Location
+serial.manage_subs.scap_id=Caption / Pattern : # %1$s
+serial.manage_subs.ssub_id=Subscription : # %1$s
+serial.manage_subs.subscriptions=Subscriptions
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/editor_base.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/editor_base.js 2011-01-25 04:44:39 UTC (rev 19279)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/editor_base.js 2011-01-25 05:21:01 UTC (rev 19280)
@@ -1,5 +1,5 @@
dump('entering serial/editor_base.js\n');
-// vim:noet:sw=4:ts=4:
+// vim:et:sw=4:ts=4:
if (typeof serial == 'undefined') serial = {};
@@ -294,7 +294,7 @@
obj.editor_values[value_key] = value;
}
if (value == "") {
- value = "<Unset>";
+ value = $('serialStrings').getString('serial.editor_base.unset');
}
} catch(E) {
obj.error.sdump('D_ERROR','Attempted ' + cmd + '\n' + E + '\n');
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_dists.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_dists.js 2011-01-25 04:44:39 UTC (rev 19279)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_dists.js 2011-01-25 05:21:01 UTC (rev 19280)
@@ -1,5 +1,5 @@
dump('entering serial/manage_dists.js\n');
-// vim:noet:sw=4:ts=4:
+// vim:et:sw=4:ts=4:
if (typeof serial == 'undefined') serial = {};
serial.manage_dists = function (params) {
@@ -1106,7 +1106,7 @@
var sstr_group_node_data = {
'row' : {
'my' : {
- 'label' : 'Streams',
+ 'label' : dojo.byId('serialStrings').getString('serial.manage_dists.streams'),
}
},
'retrieve_id' : 'sstr-group_' + sdist_tree.id(),
@@ -1185,11 +1185,20 @@
'id' : 'tree_location',
'label' : 'Location',
'flex' : 1, 'primary' : true, 'hidden' : false,
- 'render' : function(my) { return my.label ? my.label : my.sstr ? 'Stream : #' + my.sstr.id() : my.sbsum ? 'Basic Summary' : my.sssum ? 'Supplement Summary' : my.sisum ? 'Index Summary' : my.sdist ? my.sdist.label() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : "???"; },
+ 'render' : function(my) {
+ if (my.label) { return my.label; }
+ if (my.sstr) { return $('serialStrings').getFormattedString('serial.manage_dists.stream_num', [my.sstr.id()]); }
+ if (my.sbsum) { return $('serialStrings').getString('serial.manage_dists.sbsum'); }
+ if (my.sssum) { return $('serialStrings').getString('serial.manage_dists.sssum'); }
+ if (my.sisum) { return $('serialStrings').getString('serial.manage_dists.sisum'); }
+ if (my.sdist) { return my.sdist.label(); }
+ if (my.aou) { return $('serialStrings').getFormattedString('serial.manage_dists.stream_num', [my.aou.shortname(), my.aou.name()]); }
+ return "???";
+ },
},
{
'id' : 'distribution_count',
- 'label' : 'Distributions',
+ 'label' : $('serialStrings').getString('serial.manage_dists.distributions'),
'flex' : 0, 'primary' : false, 'hidden' : false,
'render' : function(my) { return my.distribution_count; },
}
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_subs.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_subs.js 2011-01-25 04:44:39 UTC (rev 19279)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/manage_subs.js 2011-01-25 05:21:01 UTC (rev 19280)
@@ -1,5 +1,5 @@
dump('entering serial/manage_subs.js\n');
-// vim:noet:sw=4:ts=4:
+// vim:et:sw=4:ts=4:
if (typeof serial == 'undefined') serial = {};
serial.manage_subs = function (params) {
@@ -289,7 +289,7 @@
var new_sdist = new sdist();
new_sdist.subscription(list[0]);//TODO: add multiple at once support?
new_sdist.holding_lib(obj.map_ssub['ssub_' + list[0]].owning_lib());//default to sub owning lib
- new_sdist.label('Default');
+ new_sdist.label($('serialStrings').getString('serial.common.default'));
new_sdist.isnew(1);
var params = {};
params.sdists = [new_sdist];
@@ -615,16 +615,16 @@
try {
var list = obj.ids_from_sel_list('ssub');
if (list.length == 0) {
- alert('You must select a subscription before predicting issuances.'); //TODO: better error
+ alert($('serialStrings').getString('serial.manage_subs.predict.alert')); //TODO: better error
return;
}
- var num_to_predict = prompt('How many items (per active pattern) would you like to predict?',
+ var num_to_predict = prompt($('serialStrings').getString('serial.manage_subs.predict.prompt'),
'12',
- 'Number of Predicted Items');
+ $('serialStrings').getString('serial.manage_subs.predict.prompt.text'));
num_to_predict = String( num_to_predict ).replace(/\D/g,'');
if (num_to_predict == '') {
- alert('Invalid number entered!'); //TODO: better error
+ alert($('serialStrings').getString('serial.manage_subs.invalid_number')); //TODO: better error
return;
}
@@ -634,7 +634,7 @@
'open-ils.serial.make_predictions',
[ ses(), {"ssub_id":list[i], "num_to_predict":num_to_predict}]
);
- alert('Successfully predicted ' + robj.length + ' issuance(s) for subscription #' + list[i] + '.');
+ alert($('serialStrings').getFormattedString('serial.manage_subs.predict_success', [robj.length, list[i]]));
}
obj.refresh_list();
@@ -1438,7 +1438,7 @@
var sdist_group_node_data = {
'row' : {
'my' : {
- 'label' : 'Distributions',
+ 'label' : $('serialStrings').getString('serial.manage_subs.distributions'),
}
},
'retrieve_id' : 'sdist-group_' + ssub_tree.id(),
@@ -1452,7 +1452,7 @@
var siss_group_node_data = {
'row' : {
'my' : {
- 'label' : 'Issuances',
+ 'label' : $('serialStrings').getString('serial.manage_subs.issuances'),
}
},
'retrieve_id' : 'siss-group_' + ssub_tree.id(),
@@ -1466,7 +1466,7 @@
var scap_group_node_data = {
'row' : {
'my' : {
- 'label' : 'Captions/Patterns',
+ 'label' : $('serialStrings').getString('serial.manage_subs.captions_patterns'),
}
},
'retrieve_id' : 'scap-group_' + ssub_tree.id(),
@@ -1536,13 +1536,22 @@
var columns = [
{
'id' : 'tree_location',
- 'label' : 'Location',
+ 'label' : $('serialStrings').getString('serial.manage_subs.tree_location'),
'flex' : 1, 'primary' : true, 'hidden' : false,
- 'render' : function(my) { return my.sdist ? my.sdist.label() : my.siss ? my.siss.label() : my.scap ? 'C/P : #' + my.scap.id() : my.ssub ? 'Subscription : #' + my.ssub.id() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : my.label ? my.label : "???"; },
+ 'render' : function(my) {
+ if (my.sdist) { return my.sdist.label(); }
+ if (my.siss) { return my.siss.label(); }
+ if (my.scap) { return $('serialStrings').getFormattedString('serial.manage_subs.scap_id', [my.scap.id()]); }
+ if (my.ssub) { return $('serialStrings').getFormattedString('serial.manage_subs.ssub_id', [my.ssub.id()]); }
+ if (my.aou) { return $('serialStrings').getFormattedString('serial.manage_dists.library_label', [my.aou.shortname(), my.aou.name()]); }
+ if (my.label) { return my.label; }
+ /* If all else fails... */
+ return "???";
+ },
},
{
'id' : 'subscription_count',
- 'label' : 'Subscriptions',
+ 'label' : $('serialStrings').getString('serial.manage_subs.subscriptions'),
'flex' : 0, 'primary' : false, 'hidden' : false,
'render' : function(my) { return my.subscription_count; },
},
More information about the open-ils-commits
mailing list