[open-ils-commits] r9276 - in trunk/Open-ILS/xul/staff_client/server: cat locale/en-US

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Apr 8 22:06:47 EDT 2008


Author: dbs
Date: 2008-04-08 21:29:35 -0400 (Tue, 08 Apr 2008)
New Revision: 9276

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
Finish i18n for the easy part of copy_editor.js


Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2008-04-08 22:16:39 UTC (rev 9275)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2008-04-09 01:29:35 UTC (rev 9276)
@@ -337,8 +337,12 @@
 			}
 
 			var r = g.error.yns_alert(
-				'Save all of these imported templates permanently to this account?',
-				'Final Warning', 'Yes', 'No', null, 'Click here'
+				$('catStrings').getString('staff.cat.copy_editor.import_templates.save.prompt'),
+				$('catStrings').getFormattedString('staff.cat.copy_editor.import_templates.save.title'),
+				$('catStrings').getString('staff.cat.copy_editor.import_templates.save.yes'),
+				$('catStrings').getString('staff.cat.copy_editor.import_templates.save.no'),
+				null,
+				$('catStrings').getString('staff.cat.copy_editor.import_templates.save.click_here')
 			);
 
 			if (r == 0 /* Yes */) {
@@ -348,13 +352,13 @@
 				if (typeof robj.ilsevent != 'undefined') {
 					throw(robj);
 				} else {
-					alert('All templates saved.');
+					alert($('catStrings').getString('staff.cat.copy_editor.import_templates.save.success'));
 					setTimeout(
 						function() {
 							try {
 								g.retrieve_templates();
 							} catch(E) {
-								g.error.standard_unexpected_error_alert('Error saving templates',E);
+								g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_editor.import_templates.save.error'), E);
 							}
 						},0
 					);
@@ -364,12 +368,12 @@
 				var list = util.functional.map_object_to_list( g.templates, function(obj,i) { return [i, i]; } );
 				g.template_menu = util.widgets.make_menulist( list );
 				$('template_placeholder').appendChild(g.template_menu);
-				alert("Note: These imported templates will get saved along with any new template you try to create, but if that doesn't happen, then these templates will disappear with the next invocation of the item attribute editor.");
+				alert($('catStrings').getString('staff.cat.copy_editor.import_templates.note'));
 			}
 
 		}
 	} catch(E) {
-		g.error.standard_unexpected_error_alert('Error importing templates',E);
+		g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_editor.import_templates.error'), E);
 	}
 }
 
@@ -446,7 +450,7 @@
 			if (!g.map_acn[copy.call_number()]) {
 				var volume = g.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ copy.call_number() ]);
 				if (typeof volume.ilsevent != 'undefined') {
-					g.error.standard_unexpected_error_alert('Error retrieving Volume information for copy ' + copy.barcode() + ".  The owning library for this copy won't be changed.",volume);
+					g.error.standard_unexpected_error_alert($('catStrings').getFormattedString('staff.cat.copy_editor.apply_owning_lib.undefined_volume.error', [copy.barcode()]), volume);
 					continue;
 				}
 				g.map_acn[copy.call_number()] = volume;
@@ -457,7 +461,7 @@
 				[ses(),old_volume.label(),old_volume.record(),ou_id]
 			);
 			if (typeof acn_id.ilsevent != 'undefined') {
-				g.error.standard_unexpected_error_alert('Error changing owning lib for copy ' + copy.barcode() + ".  The owning library for this copy won't be changed.",acn_id);
+				g.error.standard_unexpected_error_alert($('catStrings').getFormattedString('staff.cat.copy_editor.apply_owning_lib.call_number.error', [copy.barcode()], acn_id);
 				continue;
 			}
 			copy.call_number(acn_id);
@@ -1061,8 +1065,13 @@
 						label1.appendChild( document.createTextNode(value) );
 					}
 					var label2 = document.createElement('description'); row.appendChild(label2);
-					var unit = count == 1 ? 'copy' : 'copies';
-					label2.appendChild( document.createTextNode(count + ' ' + unit) );
+					var copy_count;
+					if (count == 1) {
+						copy_count = $('catStrings').getString('staff.cat.copy_editor.copy_count');
+					} else {
+						copy_count = $('catStrings').getFormattedString('staff.cat.copy_editor.copy_count.plural', [count]);
+					}
+					label2.appendChild( document.createTextNode(copy_count) );
 				}
 				var hbox = document.createElement('hbox'); 
 				hbox.setAttribute('id',fn);
@@ -1173,12 +1182,12 @@
 					util.widgets.remove_children(hbox2);
 					hbox.appendChild(x);
 					var apply = document.createElement('button');
-					apply.setAttribute('label','Apply');
-					apply.setAttribute('accesskey','A');
+					apply.setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.apply.label'));
+					apply.setAttribute('accesskey', $('catStrings').getString('staff.cat.copy_editor.apply.accesskey'));
 					hbox2.appendChild(apply);
 					apply.addEventListener('command',function() { c(x.value); },false);
 					var cancel = document.createElement('button');
-					cancel.setAttribute('label','Cancel');
+					cancel.setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.cancel.label'));
 					cancel.addEventListener('command',function() { setTimeout( function() { g.summarize( g.copies ); g.render(); document.getElementById(caption.id).focus(); }, 0); }, false);
 					hbox2.appendChild(cancel);
 					setTimeout( function() { x.focus(); }, 0 );
@@ -1217,11 +1226,11 @@
 				if (typeof r.ilsevent != 'undefined') {
 					g.error.standard_unexpected_error_alert('copy update',r);
 				} else {
-					alert('Items added/modified.');
+					alert($('catStrings').getString('staff.cat.copy_editor.handle_update.success'));
 				}
 				/* FIXME -- revisit the return value here */
 			} catch(E) {
-				alert('copy update error: ' + js2JSON(E));
+				alert($('catStrings').getString('staff.cat.copy_editor.handle_update.error') + ' ' + js2JSON(E));
 			}
 		}
 		//g.data.temp_copies = js2JSON( g.copies );
@@ -1322,7 +1331,7 @@
 
 		g.panes_and_field_names.right_pane4.push( temp_array );
 	} catch(E) {
-		g.error.standard_unexpected_error_alert('Error adding stat cat to display definition',E);
+		g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_editor.add_stat_cat.error'), E);
     }
 }
 
@@ -1422,7 +1431,7 @@
         g.panes_and_field_names.right_pane4.sort();
 
     } catch(E) {
-        g.error.standard_unexpected_error_alert('Error populating stat cats for display',E);
+        g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_editor.populate_stat_cat.error'),E);
     }
 }
 

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2008-04-08 22:16:39 UTC (rev 9275)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2008-04-09 01:29:35 UTC (rev 9276)
@@ -120,3 +120,23 @@
 staff.cat.copy_editor.import_templates.replace.yes=Yes
 staff.cat.copy_editor.import_templates.replace.no=No
 staff.cat.copy_editor.import_templates.replace.click_here=Click here
+staff.cat.copy_editor.import_templates.save.prompt=Save all of these imported templates permanently to this account?
+staff.cat.copy_editor.import_templates.save.title=Final warning
+staff.cat.copy_editor.import_templates.save.yes=Yes
+staff.cat.copy_editor.import_templates.save.no=No
+staff.cat.copy_editor.import_templates.save.click_here=Click here
+staff.cat.copy_editor.import_templates.save.success=All templates saved.
+staff.cat.copy_editor.import_templates.save.error=Error saving templates
+staff.cat.copy_editor.import_templates.note=Note: These imported templates will get saved along with any new template you try to create, but if that does not happen, then these templates will disappear with the next invocation of the item attribute editor.
+staff.cat.copy_editor.import_templates.error=Error importing templates
+staff.cat.copy_editor.apply_owning_lib.undefined_volume.error=Error retrieving Volume information for copy %1$s.  The owning library for this copy will not be changed.
+staff.cat.copy_editor.apply_owning_lib.call_number.error=Error changing owning library for copy %1$s.  The owning library for this copy will not be changed.
+staff.cat.copy_editor.copy_count=1 copy
+staff.cat.copy_editor.copy_count.plural=%1$s copies
+staff.cat.copy_editor.apply.label=Apply
+staff.cat.copy_editor.apply.accesskey=A
+staff.cat.copy_editor.cancel.label=Cancel
+staff.cat.copy_editor.handle_update.success=Items were added or modified.
+staff.cat.copy_editor.handle_update.error=copy update error:
+staff.cat.copy_editor.add_stat_cat.error=Error adding statistical category to display definition
+staff.cat.copy_editor.populate_stat_cat.error=Error populating statistical categories for display



More information about the open-ils-commits mailing list