Preserve language on refresh

This commit is contained in:
Moritz Dieing 2021-03-04 19:04:45 +01:00
parent 6cea905dc4
commit 6fdfb45b47
2 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
languageSelect = new Select<>(Locale.GERMAN, Locale.ENGLISH); languageSelect = new Select<>(Locale.GERMAN, Locale.ENGLISH);
languageSelect.setTextRenderer(renderer); languageSelect.setTextRenderer(renderer);
languageSelect.setValue(UI.getCurrent().getLocale()); languageSelect.setValue(UI.getCurrent().getLocale());
languageSelect.addValueChangeListener(event -> UI.getCurrent().setLocale(event.getValue())); languageSelect.addValueChangeListener(event -> UI.getCurrent().getSession().setLocale(event.getValue()));
languageSelect.setId(LANGUAGE_SELECT_ID); languageSelect.setId(LANGUAGE_SELECT_ID);
headingLayout.add(heading, languageSelect); headingLayout.add(heading, languageSelect);

View File

@ -223,6 +223,7 @@ public class ScreenshotIT extends AbstractIT {
executor.waitForVaadin(); executor.waitForVaadin();
assertTrue(testBench().compareScreen("testScenario1_step3")); assertTrue(testBench().compareScreen("testScenario1_step3"));
controlPanelElement.previousStep(); controlPanelElement.previousStep();
executor.waitForVaadin();
assertTrue(testBench().compareScreen("testScenario1_step2")); assertTrue(testBench().compareScreen("testScenario1_step2"));
controlPanelElement.firstStep(); controlPanelElement.firstStep();
executor.waitForVaadin(); executor.waitForVaadin();