mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
make example buttons refresh on locale change
This commit is contained in:
parent
dc60c58011
commit
3dd79320be
@ -8,6 +8,7 @@
|
||||
}
|
||||
|
||||
#headingLayout {
|
||||
min-height: 107px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
@ -39,6 +39,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
|
||||
private final Select<Locale> languageSelect;
|
||||
private final ItemLabelGenerator<Locale> renderer;
|
||||
private final Paragraph typicalcInfo;
|
||||
private final Button exampleButton;
|
||||
|
||||
/**
|
||||
* Create a new HelpDialog.
|
||||
@ -61,6 +62,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
|
||||
|
||||
headingLayout.add(heading, languageSelect, closeIcon);
|
||||
|
||||
exampleButton = InputBar.createExampleButton();
|
||||
VerticalLayout contentLayout = new VerticalLayout();
|
||||
Accordion content = createHelpContent();
|
||||
content.setId(ACCORDION_ID);
|
||||
@ -83,7 +85,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
|
||||
acc.add(new HelpContentField("root.shortcuts", "root.helpShortcuts"));
|
||||
acc.add(new HelpContentField("root.drawer", "root.helpDrawer"));
|
||||
acc.add(new HelpContentField("",
|
||||
InputBar.createExampleButton(), "root.helpExample"));
|
||||
exampleButton, "root.helpExample"));
|
||||
acc.add(new HelpContentField("root.firstStepButton",
|
||||
new Button(new Icon(VaadinIcon.ANGLE_DOUBLE_LEFT)), "root.helpFirstStepButton"));
|
||||
acc.add(new HelpContentField("root.previousStepButton",
|
||||
@ -99,6 +101,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
|
||||
|
||||
@Override
|
||||
public void localeChange(LocaleChangeEvent event) {
|
||||
exampleButton.setText(getTranslation("root.exampleButton"));
|
||||
heading.setText(getTranslation("root.operatingHelp"));
|
||||
languageSelect.setLabel(getTranslation("root.selectLanguage"));
|
||||
languageSelect.setTextRenderer(renderer);
|
||||
|
@ -138,6 +138,7 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
|
||||
@Override
|
||||
public void localeChange(LocaleChangeEvent event) {
|
||||
inputField.setPlaceholder(getTranslation("root.inputFieldPlaceholder"));
|
||||
exampleButton.setText(getTranslation("root.exampleButton"));
|
||||
inferTypeButton.setText(getTranslation("root.typeInfer"));
|
||||
typeAssumptions.setText(getTranslation("root.typeAssumptions"));
|
||||
infoIcon.getElement().setAttribute("title", getTranslation("root.inputSyntax"));
|
||||
|
Loading…
Reference in New Issue
Block a user