Don't hardcode our password forms to en-US
[working/Evergreen.git] / Open-ILS / web / opac / skin / default / js / password_reset.js
index 5382e8c..83db272 100644 (file)
@@ -41,7 +41,7 @@ dojo.addOnLoad(function() {
         }
         var deferred = dojo.xhrPost(xhrArgs);
     });
-    dojo.place("<tr><td colspan='2' align='center'><a class='classic_link' id='pwResetLink' onClick='dijit.byId(\"pwResetFormDlg\").show();'</a></td></tr>", "login_tbody");
+    dojo.place("<tr><td colspan='2' align='center'><a class='classic_link' id='pwResetLink' onClick='dijit.byId(\"pwResetFormDlg\").show();'</a></td></tr>", config.ids.login.tbody);
     dojo.query("#pwResetLink").attr("innerHTML", opac_strings.PWD_RESET_FORGOT_PROMPT);
 
 });
@@ -73,7 +73,8 @@ function createResetDialog() {
     pwResetFormDlg.startup();
 
     // Instantiate the form
-    var pwResetFormDiv = dojo.create("form", { id: "requestReset", style: "width: 30em", method: "post", action: "/opac/password/en-US" });
+    var pwResetFormURL = "/opac/password/" + (OpenSRF.locale || "en-US") + "/";
+    var pwResetFormDiv = dojo.create("form", { id: "requestReset", style: "width: 30em", method: "post", action: pwResetFormURL });
     dojo.create("p", { innerHTML: opac_strings.PWD_RESET_SUBMIT_PROMPT }, pwResetFormDiv);
     var pwResetFormTable = dojo.create("table", null, pwResetFormDiv);
     var pwResetFormTbody = dojo.create("tbody", null, pwResetFormTable);