formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing language starts from page zero in a wizard form

DonAmit197 opened this issue · comments

Hi,
I'm using your Translations method in our Wizard form.
In our wizard form, we have custom events for "Next", and "Previous" as we are using on a different environment and different use cases.
As a result, we are not using your wizard buttons.

Challenge I'm facing with Language change

I'm using the language resource api and addLanguage() method after form load inside Formio.createForm().then().
But it is reloading the step from page[0], and which is not as per our use case.

I feel this is happening due to rebuild() method used in i18next.changeLanguage method in line number 260 at Webform.js.

Can you suggest any method to modify the rebuild for this and use in "nextPage" method instead?

Thanks in advence.

Are you making a call to changeLanguage for every page, or is this something that the renderer is just doing on its own? I agree that if the latter is the case, then it should not be making the "changeLanguage" hence the rebuild call for every page. This should only be happening once during the initial form load. Regardless, even if rebuild is used, the wizard should "pick up" where it left off on the same page. This is probably something that would need to be added to the logic of the wizard. Do you have a suggestion of a change you could make to fix this? If so, then please submit a pull request and we will consider taking it for the 5.x version of the renderer that we are currently working on.