From 0cc470d49fc4d41e49a9f6752120135af9ac6a8f Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 18 Dec 2012 08:52:55 -0500 Subject: [PATCH] Dojo IDL: Set the "Accept-Language" header The internationalization support for /reports/fm_IDL.xml keys off of the Accept-Language header - which, if not set to ^[a-z]{2}-[A-Z]{2}$, falls back to en-US. Setting the header in the dojo.xhrGet() request makes Apache able to serve up the right flavour of /reports/fm_IDL.xml Signed-off-by: Dan Scott Signed-off-by: Pasi Kallinen --- Open-ILS/web/js/dojo/fieldmapper/IDL.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/fieldmapper/IDL.js b/Open-ILS/web/js/dojo/fieldmapper/IDL.js index 7efb9671fe..8ccdca52c2 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/IDL.js +++ b/Open-ILS/web/js/dojo/fieldmapper/IDL.js @@ -4,8 +4,7 @@ if(!dojo._hasResource["fieldmapper.IDL"]) { dojo.provide("fieldmapper.IDL"); dojo.declare('fieldmapper.IDL', null, { - _URL_PATH : '/reports/fm_IDL.xml', // XXX locale? - // -- just need to set up xmlent and use '/reports/'+OpenSRF.locale+'/fm_IDL.xml' + _URL_PATH : '/reports/fm_IDL.xml', NS_REPORTS : 'http://open-ils.org/spec/opensrf/IDL/reporter/v1', NS_PERSIST : 'http://open-ils.org/spec/opensrf/IDL/persistence/v1', NS_OBJ : 'http://open-ils.org/spec/opensrf/IDL/objects/v1', @@ -56,6 +55,7 @@ if(!dojo._hasResource["fieldmapper.IDL"]) { handleAs : 'xml', sync : true, timeout : 10000, + headers : {"Accept-Language": OpenSRF.locale}, load : function (response) { self._parse(response); fieldmapper.IDL.loaded = true; -- 2.43.2