0

I'm using jQuery Form Wizard and I am in the need of making it translatable. I've got the actual translation working for the form for everything but the buttons which seem hard-coded (and I am really new to jQuery).

Is there a way of making the labels change dynamically according to the rest of the translation support, which uses an URL parameter and the translated strings in variables? This is coded with php.

Edit: That I need help with is to change the label of the previous, next and submit button in jQuery Form Wizard module: http://www.thecodemine.org/#

Edit 2: Well, I've tried to actually change the value of the HTML, but it only works for the back button. Next button label is still "Next". I also tried using jQuery to change the value for me, with the same result, using #next.val("My own next value");

Daniel Holm
  • 4,347
  • 3
  • 19
  • 27

1 Answers1

2

No, PHP can only edit the document before it is loaded into the browser, not after being displayed.

  1. An option is to use a Javascript Translator such as Google Translate.
  2. Another option is to set the language of your webpage as a meta tag and hope the browser asks to translate the page (ie Google Chrome will)

Edit: Looking at the JQuery code wizard docs, there are two build in functions textNext and textBack and finally (textSubmit) ie

$('#idOfForm').formwizard('textNext','newText'); 
Community
  • 1
  • 1
Dean Meehan
  • 2,511
  • 22
  • 36
  • Thank you, but I'm afraid you misunderstood me; I've added a small edit to try to sum it up. How do I edit the label of the buttons? I want to be able to edit "Previous" "Next" and "Submit" – Daniel Holm Mar 28 '14 at 16:26
  • Hope that helps.. :) If it does, remove downvote and accept ans – Dean Meehan Apr 01 '14 at 11:26
  • Thank you, that was was I needed. Totally did not see that function. – Daniel Holm Apr 01 '14 at 16:30
  • Blindness always happens when there is so much information. Blame the Doc's for not being clear enough! (y) – Dean Meehan Apr 01 '14 at 16:32
  • This code broke my form. As I click the next button, more than one item in the form is presented. Is there anything else that needs to be added to this code so that it plays well with the jquery.form.wizard.js library? `$(function () {` `$("#wizard3").formwizard({` `textSubmit : 'Entregar',` `textNext : 'Continuar',` `textBack : 'Regresar'` `});` `});` – 655321 Jan 06 '15 at 21:29