[open-ils-commits] r11629 - in branches/rel_1_4/Open-ILS/xul/staff_client/chrome: content/main content/util locale/en-US

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Dec 19 15:12:18 EST 2008


Author: dbs
Date: 2008-12-19 15:12:14 -0500 (Fri, 19 Dec 2008)
New Revision: 11629

Modified:
   branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/main.js
   branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js
   branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/util/network.js
   branches/rel_1_4/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
Log:
Merge 11390-11392 from trunk for i18n of network strings


Modified: branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/main.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/main.js	2008-12-19 18:50:23 UTC (rev 11628)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/main.js	2008-12-19 20:12:14 UTC (rev 11629)
@@ -100,7 +100,7 @@
                 cookieSvc.setCookieString(cookieUriSSL, null, "ses="+G.data.session.key, null);
 
             } catch(E) {
-                alert('Error setting session cookie: ' + E);
+                alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
             }
 
 			grant_perms(url);

Modified: branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2008-12-19 18:50:23 UTC (rev 11628)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2008-12-19 20:12:14 UTC (rev 11629)
@@ -497,9 +497,9 @@
 								cookieSvc.setCookieString(cookieUri, null, "ses="+obj.data.session.key, null);
 								cookieSvc.setCookieString(cookieUriSSL, null, "ses="+obj.data.session.key, null);
 
-            } catch(E) {
-                alert('Error setting session cookie: ' + E);
-            }
+					    } catch(E) {
+						    alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
+					    }
 
 							removeCSSClass(document.getElementById('main_tabbox'),'operator_change');
 						} else {

Modified: branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/util/network.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/util/network.js	2008-12-19 18:50:23 UTC (rev 11628)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/util/network.js	2008-12-19 20:12:14 UTC (rev 11629)
@@ -1,5 +1,9 @@
 dump('entering util/network.js\n');
+// vim:noet:sw=4:ts=4:
 
+var offlineStrings;
+offlineStrings = document.getElementById('offlineStrings');
+
 if (typeof util == 'undefined') util = {};
 util.network = function () {
 
@@ -20,7 +24,9 @@
 		//var sparams = js2JSON(params);
 		//obj.error.sdump('D_SES','simple_request '+ method_id +' '+obj.error.pretty_print(sparams.slice(1,sparams.length-1))+
 		//	'\noverride_params = ' + override_params + '\n');
-		if (typeof api[method_id] == 'undefined') throw( 'Method not found for ' + method_id );
+		if (typeof api[method_id] == 'undefined') {
+			throw( offlineStrings.getFormattedString('network.method_not_found.error', [method_id]) );
+		}
 		var secure = true; if (typeof api[method_id].secure != 'undefined') secure = api[method_id].secure;
 		return this.request(api[method_id].app,api[method_id].method,params,f,override_params,{ 'secure' : secure, 'method_id' : method_id });
 	},
@@ -38,7 +44,7 @@
 					try { obj.NETWORK_FAILURE = js2JSON(E); } catch(F) { dump(F + '\n'); obj.NETWORK_FAILURE = E; };
 				}
 			} catch(I) { 
-				obj.NETWORK_FAILURE = 'Unknown status';
+				obj.NETWORK_FAILURE = offlineStrings.getString('network.unknown_status');
 			}
 			result = null;
 		}
@@ -106,7 +112,7 @@
 						} catch(E) {
 							try {
 								E.ilsevent = -2;
-								E.textcode = 'Server/Method Error';
+								E.textcode = offlineStrings.getString('network.server_or_method.error');
 							} catch(F) {}
 							f( { 'getResultObject' : function() { return E; } } );
 						}
@@ -176,11 +182,23 @@
 				try { network_failure_string = String( obj.NETWORK_FAILURE ); } catch(E) { network_failure_string = E; }
 				try { network_failure_status_string = typeof obj.NETWORK_FAILURE == 'object' && typeof obj.NETWORK_FAILURE != 'null' && typeof obj.NETWORK_FAILURE.status == 'function' ? obj.NETWORK_FAILURE.status() : ''; } catch(E) { network_failure_status_string = ''; obj.error.sdump('D_ERROR', 'setting network_failure_status_string: ' + E); }
 				
-				try { msg = 'Network/server failure.  Please check your Internet connection to ' + data.server_unadorned + ' and choose Retry Network.  If you need to enter Offline Mode, choose Ignore Errors in this and subsequent dialogs.  If you believe this error is due to a bug in Evergreen and not network problems, please contact your helpdesk or friendly Evergreen admins, and give them this information:\nmethod=' + name + '\nparams=' + js2JSON(params) + '\nTHROWN:\n' + network_failure_string + '\nSTATUS:\n' + network_failure_status_string; } catch(E) { msg = E; }
+				try { msg = offlineStrings.getFormattedString('network.server.failure.exception', [data.server_unadorned]) + '\n' +
+							offlineStrings.getFormattedString('network.server.method', [name]) + '\n' + 
+							offlineStrings.getFormattedString('network.server.params', [js2JSON(params)]) + '\n' + 
+							offlineStrings.getString('network.server.thrown_label') + '\n' + network_failure_string + '\n' + 
+							offlineStrings.getString('network.server.status_label') + '\n' + network_failure_status_string;
+				} catch(E) { msg = E; }
 
 				try { obj.error.sdump('D_SES_ERROR',msg); } catch(E) { alert(E); }
 
-				r = obj.error.yns_alert(msg,'Network Failure','Retry Network','Ignore Errors',null,'Check here to confirm this message');
+				r = obj.error.yns_alert(
+					msg,
+					offlineStrings.getString('network.network_failure'),
+					offlineStrings.getString('network.retry_network'),
+					offlineStrings.getString('network.ignore_errors'),
+					null,
+					offlineStrings.getString('common.confirm')
+				);
 				if (r == 1) {
 					data.proceed_offline = true; data.stash('proceed_offline');
 					dump('Remembering proceed_offline for 200000 ms.\n');
@@ -201,8 +219,9 @@
 					if (obj.get_result(req)) proceed = true; /* daily WTF, why am I even doing this? :) */
 					return req;
 				break;
+
 				case 1: 
-					return { 'getResultObject' : function() { return { 'ilsevent' : -1, 'textcode' : 'Network/Server Problem' }; } };
+					return { 'getResultObject' : function() { return { 'ilsevent' : -1, 'textcode' : offlineStrings.getString('network.server_or_method.error') }; } };
 				break;
 			}
 		}
@@ -228,7 +247,7 @@
 				}
 			}
 		} catch(E) {
-			obj.error.standard_unexpected_error_alert('Error setting window titles to match new login',E);
+			obj.error.standard_unexpected_error_alert(offlineStrings.getString('network.window_title.error'),E);
 		}
 	},
 
@@ -246,12 +265,12 @@
 			//+ '&desc_brief=' + window.escape( text ? 'Session Expired' : 'Operator Change' )
 			//+ '&desc_full=' + window.escape( text ? 'Please enter the credentials for a new login session.' : 'Please enter the credentials for the new login session.  Note that the previous session is still active.'),
 			//'simple_auth' + (new Date()).toString(),
-			'Authorize',
+			offlineStrings.getString('network.new_session.authorize'),
 			'chrome,resizable,modal,width=700,height=500',
 			{
 				'login_type' : 'staff',
-				'desc_brief' : text ? 'Session Expired' : 'Operator Change',
-				'desc_full' : text ? 'Please enter the credentials for a new login session.' : 'Please enter the credentials for the new login session.  Note that the previous session is still active.'
+				'desc_brief' : text ? offlineStrings.getString('network.new_session.expired') : offlineStrings.getString('network.new_session.operator_change'),
+				'desc_full' : text ? offlineStrings.getString('network.new_session.expired.prompt') : offlineStrings.getString('network.new_session.operator_change.prompt')
 				//'simple_auth' : (new Date()).toString(),
 			}
 		);
@@ -271,7 +290,7 @@
                 cookieSvc.setCookieString(cookieUriSSL, null, "ses="+data.session.key, null);
 
             } catch(E) {
-                alert('Error setting session cookie: ' + E);
+                alert(offineStrings.getFormattedString('main.session_cookie.error', [E]));
             }
 			if (! data.list.au ) data.list.au = [];
 			data.list.au[0] = JSON2js( data.temporary_session.usr );
@@ -322,12 +341,12 @@
 						//+ '&desc_brief=' + window.escape('Permission Denied: ' + robj.ilsperm)
 						//+ '&desc_full=' + window.escape('Another staff member with the above permission may authorize this specific action.  Please notify your library administrator if you need this permission.  If you feel you have received this exception in error, inform your friendly Evergreen developers of the above permission and this debug information: ' + name),
 						//'simple_auth' + (new Date()).toString(),
-						'Authorize',
+						offlineStrings.getFormattedString('network.permission.authorize'),
 						'chrome,resizable,modal,width=700,height=500',
 						{
 							'login_type' : 'temp',
-							'desc_brief' : 'Permission Denied: ' + robj.ilsperm,
-							'desc_full' : 'Another staff member with the above permission may authorize this specific action.  Please notify your library administrator if you need this permission.  If you feel you have received this exception in error, please inform your friendly Evergreen developers or helpdesk staff of the above permission and this debug information: ' + name
+							'desc_brief' : offlineStrings.getFormattedString('network.permission.description.brief', [robj.ilsperm]),
+							'desc_full' : offlineStrings.getFormattedString('network.permission.description.full', [name])
 							//'simple_auth' : (new Date()).toString(),
 						}
 					);
@@ -354,7 +373,7 @@
 					netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
 					obj.sound.bad();
 					var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">' + 
-						'<groupbox><caption label="Exceptions"/>' + 
+						'<groupbox><caption label="' + offlineStrings.getString('network.override.exceptions') + '"/>' + 
 						'<grid><columns><column/><column/></columns><rows>';
 					for (var i = 0; i < r.length; i++) {
 						var t1 = String(r[i].ilsevent).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
@@ -366,10 +385,10 @@
 							'<description>' + t3 + '</description>' + 
 							'</row><row>' + '<description>' + t4 + '</description>' + '</row>';
 					}
-					xml += '</rows></grid></groupbox><groupbox><caption label="Override"/><hbox>' + 
-						'<description>Force this action?</description>' + 
-						'<button accesskey="N" label="No" name="fancy_cancel"/>' + 
-						'<button id="override" accesskey="Y" label="Yes" name="fancy_submit" value="override"/></hbox></groupbox></vbox>';
+					xml += '</rows></grid></groupbox><groupbox><caption label="' + offlineStrings.getString('network.override.override') +'"/><hbox>' + 
+						'<description>' + offlineStrings.getString('network.override.force.prompt') + '</description>' + 
+						'<button accesskey="' + offlineStrings.getString('common.no.accesskey') + '" label="' + offlineStrings.getString('common.no') + '" name="fancy_cancel"/>' + 
+						'<button id="override" accesskey="' + offlineStrings.getString('common.yes.accesskey') + '" label="' + offlineStrings.getString('common.yes') + '" name="fancy_submit" value="override"/></hbox></groupbox></vbox>';
 					//JSAN.use('OpenILS.data');
 					//var data = new OpenILS.data(); data.init({'via':'stash'});
 					//data.temp_override_xml = xml; data.stash('temp_override_xml');

Modified: branches/rel_1_4/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2008-12-19 18:50:23 UTC (rev 11628)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2008-12-19 20:12:14 UTC (rev 11629)
@@ -12,7 +12,9 @@
 common.barcode.status.warning.unknown=with an unknown code: %1$s
 common.date.invalid=Invalid Date
 common.no=No
+common.no.accesskey=N
 common.yes=Yes
+common.yes.accesskey=Y
 common.unimplemented=Not Yet Implemented
 cat.bib_record=Bib Record: %1$s
 cat.opac.delete_record.confirm=Are you sure you want to delete title record #%1$s from the catalog?
@@ -132,6 +134,7 @@
 menu.spawn_search.msg=Editor would like to search for: %1$s
 menu.close_all_tabs.error=Error closing all tabs
 menu.new_tab.tab=Tab
+main.session_cookie.error=Error setting session cookie: %1$s
 menu.set_tab.error=pause for error
 main.testing=Testing
 main.transaction_export.title=Save Transaction File As
@@ -154,6 +157,29 @@
 main.settings.migrate.failed=WARNING: Unable to migrate legacy settings.  The settings and configuration files appear to exist in multiple locations. \nTo resolve this problem manually, please consider:\n\t%1$s\nwhich is in the directory where we want to store settings for the current operating system account, and:\n\t%2$s\nwhich is where we used to store such information.\n
 main.settings.migrate.confirm=Move the settings and configuration files from\n%1$s\nto\n%2$s?
 main.settings.migrate.error=Error trying to move %1$s to directory %2$s
+network.override.exceptions=Exceptions
+network.override.override=Override 
+network.override.force.prompt=Force this action?
+network.ignore_errors=Ignore Errors
+network.method_not_found.error=Method not found for %1$s
+network.new_session.authorize=Authorize
+network.new_session.expired=Session Expired
+network.new_session.expired.prompt=Please enter the credentials for a new login session.
+network.new_session.operator_change=Operator Change
+network.new_session.operator_change.prompt=Please enter the credentials for the new login session.  Note that the previous session is still active.
+network.permission.authorize=Authorize
+network.permission.description.brief=Permission Denied: %1$s
+network.permission.description.full=Another staff member with the above permission may authorize this specific action.  Please notify your library administrator if you need this permission.  If you feel you have received this exception in error, please inform your friendly Evergreen developers or helpdesk staff of the above permission and this debug information: %1$s
+network.server_or_method.error=Server or method error
+network.server.failure.exception=Network or server failure.  Please check your Internet connection to %1$s and choose Retry Network.  If you need to enter Offline Mode, choose Ignore Errors in this and subsequent dialogs.  If you believe this error is due to a bug in Evergreen and not network problems, please contact your help desk or friendly Evergreen administrators, and give them this information:
+network.server.method=method=%1$s
+network.server.params=params=%1%s
+network.server.thrown_label=THROWN:
+network.server.status_label=STATUS:
+network.network_failure=Network Failure
+network.retry_network=Retry Network
+network.unknown_status=Unknown status
+network.window_title.error=Error setting window titles to match new login
 openils.global_util.clear_cache.error=Problem clearing the cache: %1$s
 openils.global_util.clipboard.error=Clipboard action failed: %1$s
 openils.global_util.clipboard=Copied "%1$s" to clipboard.



More information about the open-ils-commits mailing list