bhits / consent2share

Set up Consent2Share Including Infrastructure and Applications
https://bhits.github.io/consent2share/
Apache License 2.0
40 stars 10 forks source link

Translation on the Date Picker does not Take Effect until the Page is Reloaded #16

Open shruti-rao opened 7 years ago

shruti-rao commented 7 years ago
  1. Select English language, and go to the "Consents" menu. Select "Add a Consent"
  2. Scroll down the page and click on "Consent Start." You will see the Date Picker in English.
  3. Remain on the page, and change the language to Spanish.
  4. You will see the text being changed to Spanish, except the Date Picker as shown below. image
  5. Click on the browser's "Reload this Page" button. After the page is refreshed, you will see the Date Picker changed to Spanish as shown below. image
  6. The same issue exists if you change from Spanish to English.
ghost commented 7 years ago

@shruti-rao: I believe the reason this is happening is that the datepicker objects are initialized when the page is loaded based on the values of the HTML elements it is set to key off of. Once the page is loaded, changing the selected language may change the values in the HTML elements that the datapickers were initialized from, but the values in the datepickers themselves won't change unless the datapicker objects are re-initialized. I suspect this issue might be able to be fixed by changing the AngularJS/JavaScript code on this page to re-initialize the datepicker objects whenever the selected lanaguage is changed.