[open-ils-commits] r12197 - trunk/Open-ILS/xul/staff_client/server/cat (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 16 23:59:15 EST 2009
Author: dbs
Date: 2009-02-16 23:59:13 -0500 (Mon, 16 Feb 2009)
New Revision: 12197
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
Log:
en-US is better than no MARC editor tooltips at all; but we really need to HEAD the requested locale
Modified: trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js 2009-02-17 04:10:06 UTC (rev 12196)
+++ trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js 2009-02-17 04:59:13 UTC (rev 12197)
@@ -124,18 +124,26 @@
// Try to get the locale from our preferences
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- try {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- locale = Cc["@mozilla.org/preferences-service;1"].
+ try {
+ const Cc = Components.classes;
+ const Ci = Components.interfaces;
+ locale = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch).
getCharPref("general.useragent.locale");
- }
+ }
catch (e) { }
+ // TODO: We should send a HEAD request to check for the existence of the desired file
+ // then fall back to the default locale if preferred locale is not necessary;
+ // however, for now we have a simplistic check:
+ //
+ // we currently have translations for only two locales; in the absence of a
+ // valid locale, default to the almighty en-US
+ if (locale != 'en-US' && locale != 'fr-CA') {
+ locale = 'en-US';
+ }
+
// Get the locale-specific tooltips
- // TODO: We should send a HEAD request to check for the existence of the desired file
- // then fall back to the default locale if preferred locale is not necessary
req.open('GET','/xul/server/locale/' + locale + '/marcedit-tooltips.xml',true);
context_menus = createComplexXULElement('popupset');
More information about the open-ils-commits
mailing list