From: Dan Scott <dscott@laurentian.ca>
Date: Tue, 18 Dec 2012 13:52:55 +0000 (-0500)
Subject: Dojo IDL: Set the "Accept-Language" header
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0cc470d49fc4d41e49a9f6752120135af9ac6a8f;p=contrib%2FConifer.git

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 <dscott@laurentian.ca>
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
---

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;