From 2299ec4a8778dcbb6e2db8f4427ec3fca86d602d Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 22 Jun 2017 17:27:54 +0200 Subject: [PATCH] fix localization --- .../java/de/hsadmin/web/CustomerPanel.java | 8 ++++---- .../de/hsadmin/web/DomainOptionsEditor.java | 6 +++--- .../main/java/de/hsadmin/web/DomainPanel.java | 4 ++-- .../java/de/hsadmin/web/EMailTargetEditor.java | 18 +++++++++--------- .../de/hsadmin/web/EntryPointsSelector.java | 2 +- .../java/de/hsadmin/web/GenericFormWindow.java | 5 ++++- .../main/java/de/hsadmin/web/HSConfirmBox.java | 2 +- .../java/de/hsadmin/web/HSPasswordField.java | 3 ++- web/src/main/java/de/hsadmin/web/HSSelect.java | 3 ++- web/src/main/java/de/hsadmin/web/HSTab.java | 2 +- .../main/java/de/hsadmin/web/HSTextField.java | 3 ++- .../main/java/de/hsadmin/web/HelpWindow.java | 2 +- web/src/main/java/de/hsadmin/web/I18N.java | 11 ++++++++--- .../main/java/de/hsadmin/web/LoginWindow.java | 15 ++++++++------- .../main/java/de/hsadmin/web/MainPanel.java | 4 ++-- .../main/java/de/hsadmin/web/MainToolbar.java | 2 +- .../main/java/de/hsadmin/web/PackagePanel.java | 16 ++++++++-------- .../main/java/de/hsadmin/web/PanelToolbar.java | 4 ++-- .../java/de/hsadmin/web/UserProfileWindow.java | 5 ++++- 19 files changed, 65 insertions(+), 50 deletions(-) diff --git a/web/src/main/java/de/hsadmin/web/CustomerPanel.java b/web/src/main/java/de/hsadmin/web/CustomerPanel.java index bcae029..2a67d6f 100644 --- a/web/src/main/java/de/hsadmin/web/CustomerPanel.java +++ b/web/src/main/java/de/hsadmin/web/CustomerPanel.java @@ -33,14 +33,14 @@ public class CustomerPanel extends CustomComponent implements IHSPanel, Selected tabsheet.setSizeFull(); tabsheet.addSelectedTabChangeListener(this); tabsheet.addSelectedTabChangeListener(this); - tabsheet.addTab(new GenericForm("customer", session, itemId, "name"), I18N.getText("customer")); + tabsheet.addTab(new GenericForm("customer", session, itemId, "name"), I18N.getText("customer", getLocale())); final HSTab usersTab = new HSTab("contact", session, "customer", itemId, "email"); usersTab.fillTable(); - tabsheet.addTab(usersTab, I18N.getText("contact")); + tabsheet.addTab(usersTab, I18N.getText("contact", getLocale())); HSTab aliasTab = new HSTab("mandat", session, "customer", itemId, "mandatRef"); - tabsheet.addTab(aliasTab, I18N.getText("mandat")); + tabsheet.addTab(aliasTab, I18N.getText("mandat", getLocale())); HSTab pacTab = new HSTab("pac", session, "customer", itemId, "name"); - tabsheet.addTab(pacTab, I18N.getText("pac")); + tabsheet.addTab(pacTab, I18N.getText("pac", getLocale())); return tabsheet; } diff --git a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java index 7b37388..c0aa152 100644 --- a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java +++ b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java @@ -27,14 +27,14 @@ public class DomainOptionsEditor extends CustomComponent implements IHSEditor { public DomainOptionsEditor(final PropertyInfo propertyInfo, final HSAdminSession session, final Map whereContext) { this.checkboxes = new HashMap<>(); this.propertyInfo = propertyInfo; - this.setCaption(I18N.getText(propertyInfo.getName())); + this.setCaption(I18N.getText(propertyInfo.getName(), getLocale())); layout = new VerticalLayout(); for (String opt : OPTIONS) { - final CheckBox checkBox = new CheckBox(I18N.getText("domainoption." + opt)); + final CheckBox checkBox = new CheckBox(I18N.getText("domainoption." + opt, getLocale())); checkboxes.put(opt, checkBox); layout.addComponent(checkBox); } - layout.setCaption(I18N.getText(propertyInfo.getName())); + layout.setCaption(I18N.getText(propertyInfo.getName(), getLocale())); setCompositionRoot(layout); } diff --git a/web/src/main/java/de/hsadmin/web/DomainPanel.java b/web/src/main/java/de/hsadmin/web/DomainPanel.java index c352dab..8d75666 100644 --- a/web/src/main/java/de/hsadmin/web/DomainPanel.java +++ b/web/src/main/java/de/hsadmin/web/DomainPanel.java @@ -30,10 +30,10 @@ public class DomainPanel extends CustomComponent implements IHSPanel, SelectedTa public TabSheet createTabs(Object itemId) throws RpcException { final TabSheet tabsheet = new TabSheet(); - tabsheet.addTab(new GenericForm("domain", session, itemId, "name"), I18N.getText("domain")); + tabsheet.addTab(new GenericForm("domain", session, itemId, "name"), I18N.getText("domain", getLocale())); HSTab emailTab = new HSTab("emailaddress", session, "domain", itemId, "id"); emailTab.fillTable(); - tabsheet.addTab(emailTab, I18N.getText("emailaddress")); + tabsheet.addTab(emailTab, I18N.getText("emailaddress", getLocale())); return tabsheet; } diff --git a/web/src/main/java/de/hsadmin/web/EMailTargetEditor.java b/web/src/main/java/de/hsadmin/web/EMailTargetEditor.java index 150fad9..b91830c 100644 --- a/web/src/main/java/de/hsadmin/web/EMailTargetEditor.java +++ b/web/src/main/java/de/hsadmin/web/EMailTargetEditor.java @@ -44,12 +44,12 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val this.isEditAble = PanelToolbar.ACTION_EDIT.equals(action) || PanelToolbar.ACTION_NEW.equals(action); this.propertyInfo = propertyInfo; this.validators = new ArrayList<>(); - this.setCaption(I18N.getText(propertyInfo.getName())); + this.setCaption(I18N.getText(propertyInfo.getName(), getLocale())); this.aliases = targetsSelect("emailalias", session, whereContext); this.postboxes = targetsSelect("user", session, whereContext); postboxes.removeAll(aliases); layout = new VerticalLayout(); - layout.setCaption(I18N.getText(propertyInfo.getName())); + layout.setCaption(I18N.getText(propertyInfo.getName(), getLocale())); setCompositionRoot(layout); } @@ -175,7 +175,7 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val targetTypeSelect.setMultiSelect(false); targetTypeSelect.setNullSelectionAllowed(true); targetTypeSelect.setNullSelectionItemId(" "); - targetTypeSelect.addItems(new Object[] { " ", I18N.getText("emailtarget.email"), I18N.getText("emailtarget.postbox"), I18N.getText("emailtarget.alias") }); + targetTypeSelect.addItems(new Object[] { " ", I18N.getText("emailtarget.email", getLocale()), I18N.getText("emailtarget.postbox", getLocale()), I18N.getText("emailtarget.alias", getLocale()) }); targetTypeSelect.setValue(" "); targetTypeSelect.setWidth("6.0em"); addComponent(targetTypeSelect); @@ -184,7 +184,7 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val AbstractComponent targetField = null; NativeSelect sel = null; if (aliases.contains(target)) { - targetTypeSelect.setValue(I18N.getText("emailtarget.alias")); + targetTypeSelect.setValue(I18N.getText("emailtarget.alias", getLocale())); sel = new NativeSelect(); sel.addItems(aliases); sel.setValue(target); @@ -193,7 +193,7 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val targetField = sel; } else { if (postboxes.contains(target)) { - targetTypeSelect.setValue(I18N.getText("emailtarget.postbox")); + targetTypeSelect.setValue(I18N.getText("emailtarget.postbox", getLocale())); sel = new NativeSelect(); sel.addItems(postboxes); sel.setValue(target); @@ -201,7 +201,7 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val sel.setEnabled(isEditAble); targetField = sel; } else { - targetTypeSelect.setValue(I18N.getText("emailtarget.email")); + targetTypeSelect.setValue(I18N.getText("emailtarget.email", getLocale())); targetField = new TextField(); targetField.setEnabled(isEditAble); ((TextField) targetField).setValue(target); @@ -229,16 +229,16 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val final String newValue = newValueObject.toString(); if (targetRow.getComponentCount() == 1) { AbstractComponent comp = null; - if (I18N.getText("emailtarget.email").equals(newValue)) { + if (I18N.getText("emailtarget.email", getLocale()).equals(newValue)) { final TextField textField = new TextField(); textField.addValueChangeListener(editor); textField.setImmediate(true); textField.setEnabled(isEditAble); comp = textField; } else { - if (I18N.getText("emailtarget.alias").equals(newValue) || I18N.getText("emailtarget.postbox").equals(newValue)) { + if (I18N.getText("emailtarget.alias", getLocale()).equals(newValue) || I18N.getText("emailtarget.postbox", getLocale()).equals(newValue)) { final NativeSelect select = new NativeSelect(); - if (I18N.getText("emailtarget.alias").equals(newValue)) { + if (I18N.getText("emailtarget.alias", getLocale()).equals(newValue)) { select.addItems(aliases); } else { select.addItems(postboxes); diff --git a/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java b/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java index db7918f..75237c8 100644 --- a/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java +++ b/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java @@ -45,7 +45,7 @@ public class EntryPointsSelector extends CustomComponent implements ItemClickLis final AbstractEntryPointsFactory entryPointsFactory = FactoryProducer.getEntryPointsFactory(mainWindow, "default"); int tabCount = 0; for(String tabName : entryPointsFactory.getEntryPointNames(role)) { - accordion.addTab(new EntryPoint(this, tabName), I18N.getText(tabName)); + accordion.addTab(new EntryPoint(this, tabName), I18N.getText(tabName, getLocale())); tabCount++; } if (tabCount > 0) { diff --git a/web/src/main/java/de/hsadmin/web/GenericFormWindow.java b/web/src/main/java/de/hsadmin/web/GenericFormWindow.java index bd95b01..9d9f771 100644 --- a/web/src/main/java/de/hsadmin/web/GenericFormWindow.java +++ b/web/src/main/java/de/hsadmin/web/GenericFormWindow.java @@ -2,6 +2,7 @@ package de.hsadmin.web; import java.util.HashMap; import java.util.Iterator; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -24,7 +25,9 @@ public class GenericFormWindow extends Window implements IHSWindow { public GenericFormWindow(final HSTab parent, final String module, final String action, final HSAdminSession session, final Map whereContext) { - super(I18N.getText(action) + " " + I18N.getText(module)); + super(); + final Locale locale = getLocale(); + setCaption(I18N.getText(action, locale) + " " + I18N.getText(module, locale)); this.parent = parent; center(); setModal(true); diff --git a/web/src/main/java/de/hsadmin/web/HSConfirmBox.java b/web/src/main/java/de/hsadmin/web/HSConfirmBox.java index 813a309..af6bcdf 100644 --- a/web/src/main/java/de/hsadmin/web/HSConfirmBox.java +++ b/web/src/main/java/de/hsadmin/web/HSConfirmBox.java @@ -85,7 +85,7 @@ public class HSConfirmBox extends HorizontalLayout { } } }); - cancelButton = new Button(I18N.getText("cancel")); + cancelButton = new Button(I18N.getText("cancel", getLocale())); cancelButton.setClickShortcut(KeyCode.ESCAPE); cancelButton.addClickListener(new ClickListener() { diff --git a/web/src/main/java/de/hsadmin/web/HSPasswordField.java b/web/src/main/java/de/hsadmin/web/HSPasswordField.java index 0460c9b..ba3d538 100644 --- a/web/src/main/java/de/hsadmin/web/HSPasswordField.java +++ b/web/src/main/java/de/hsadmin/web/HSPasswordField.java @@ -9,7 +9,8 @@ public class HSPasswordField extends PasswordField implements IHSEditor { private static final long serialVersionUID = 1L; public HSPasswordField(final String name, final boolean passwordRequired) { - super(I18N.getText(name)); + super(); + setCaption(I18N.getText(name, getLocale())); addValidator(new PasswordValidator(passwordRequired)); } diff --git a/web/src/main/java/de/hsadmin/web/HSSelect.java b/web/src/main/java/de/hsadmin/web/HSSelect.java index 3edefb8..7979ac3 100644 --- a/web/src/main/java/de/hsadmin/web/HSSelect.java +++ b/web/src/main/java/de/hsadmin/web/HSSelect.java @@ -16,7 +16,8 @@ public class HSSelect extends NativeSelect implements IHSEditor { } public HSSelect(final String label, final int defaultIndex, final List values) { - super(I18N.getText(label)); + super(); + setCaption(I18N.getText(label, getLocale())); this.propertyName = label; super.addItems(values); if (values != null && values.size() > defaultIndex) { diff --git a/web/src/main/java/de/hsadmin/web/HSTab.java b/web/src/main/java/de/hsadmin/web/HSTab.java index 0e4bca4..1d5b47f 100644 --- a/web/src/main/java/de/hsadmin/web/HSTab.java +++ b/web/src/main/java/de/hsadmin/web/HSTab.java @@ -149,7 +149,7 @@ public class HSTab extends CustomComponent { while (properties.hasNext()) { final PropertyInfo propertyInfo = properties.next(); if (showColumnInTable(propertyInfo)) { - grid.addContainerProperty(I18N.getText(propertyInfo.getModule() + "." + propertyInfo.getName()), String.class, ""); + grid.addContainerProperty(I18N.getText(propertyInfo.getModule() + "." + propertyInfo.getName(), getLocale()), String.class, ""); } } grid.setSelectable(true); diff --git a/web/src/main/java/de/hsadmin/web/HSTextField.java b/web/src/main/java/de/hsadmin/web/HSTextField.java index e925c87..1a2bc32 100644 --- a/web/src/main/java/de/hsadmin/web/HSTextField.java +++ b/web/src/main/java/de/hsadmin/web/HSTextField.java @@ -11,7 +11,8 @@ public class HSTextField extends TextField implements IHSEditor { private final String propertyName; public HSTextField(final String name) { - super(I18N.getText(name)); + super(); + setCaption(I18N.getText(name, getLocale())); this.propertyName = name; } diff --git a/web/src/main/java/de/hsadmin/web/HelpWindow.java b/web/src/main/java/de/hsadmin/web/HelpWindow.java index 6d0ad64..19fc72c 100644 --- a/web/src/main/java/de/hsadmin/web/HelpWindow.java +++ b/web/src/main/java/de/hsadmin/web/HelpWindow.java @@ -25,7 +25,7 @@ public class HelpWindow extends Window { final VerticalLayout subContent = new VerticalLayout(); subContent.setMargin(true); subContent.setSizeFull(); - final String helpBaseURL = I18N.getText("help.baseurl"); + final String helpBaseURL = I18N.getText("help.baseurl", getLocale()); final Component helpContent = new BrowserFrame("Help Window", new ExternalResource(helpBaseURL + helpTopic)); helpContent.setSizeFull(); subContent.addComponent(helpContent); diff --git a/web/src/main/java/de/hsadmin/web/I18N.java b/web/src/main/java/de/hsadmin/web/I18N.java index df14604..3b139dc 100644 --- a/web/src/main/java/de/hsadmin/web/I18N.java +++ b/web/src/main/java/de/hsadmin/web/I18N.java @@ -1,16 +1,21 @@ package de.hsadmin.web; +import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; public class I18N { - private static final ResourceBundle TEXTS = ResourceBundle.getBundle("de.hsadmin.web.main"); + private static final ResourceBundle TEXTS_DE = ResourceBundle.getBundle("de.hsadmin.web.main", Locale.GERMAN); + private static final ResourceBundle TEXTS_EN = ResourceBundle.getBundle("de.hsadmin.web.main", Locale.ENGLISH); - public static String getText(final String textProperty) { + public static String getText(final String textProperty, final Locale loc) { String textValue; try{ - textValue = I18N.TEXTS.getString(textProperty); + textValue = I18N.TEXTS_EN.getString(textProperty); + if (loc.getLanguage().equals(Locale.GERMAN.getLanguage())) { + textValue = I18N.TEXTS_DE.getString(textProperty); + } }catch(MissingResourceException e){ textValue = "./. " + textProperty; } diff --git a/web/src/main/java/de/hsadmin/web/LoginWindow.java b/web/src/main/java/de/hsadmin/web/LoginWindow.java index f97ab51..3cd686e 100644 --- a/web/src/main/java/de/hsadmin/web/LoginWindow.java +++ b/web/src/main/java/de/hsadmin/web/LoginWindow.java @@ -27,7 +27,8 @@ public class LoginWindow extends Window { private static final long serialVersionUID = 1L; public LoginWindow(final HSAdminUI parent, final TicketService ticketService) { - super(I18N.getText("login.title")); + super(); + setCaption(I18N.getText("login.title", getLocale())); center(); setModal(true); setWidth("480px"); @@ -35,11 +36,11 @@ public class LoginWindow extends Window { final FormLayout subContent = new FormLayout(); subContent.setMargin(true); - final TextField login = new TextField(I18N.getText("user.name")); + final TextField login = new TextField(I18N.getText("user.name", getLocale())); login.setWidth("100%"); subContent.addComponent(login); login.focus(); - final PasswordField password = new PasswordField(I18N.getText("password")); + final PasswordField password = new PasswordField(I18N.getText("password", getLocale())); password.setWidth("100%"); subContent.addComponent(password); final Label feedback = new Label(""); @@ -48,7 +49,7 @@ public class LoginWindow extends Window { subContent.addComponent(feedback); feedback.setStyleName(ValoTheme.LABEL_FAILURE); - final Button okButton = new Button(I18N.getText("login.button")); + final Button okButton = new Button(I18N.getText("login.button", getLocale())); okButton.setStyleName(ValoTheme.BUTTON_PRIMARY); okButton.setClickShortcut(KeyCode.ENTER); okButton.addClickListener(new ClickListener() @@ -74,9 +75,9 @@ public class LoginWindow extends Window { } } try { - final String user = credentials.get(I18N.getText("user.name")); + final String user = credentials.get(I18N.getText("user.name", getLocale())); final String loginUser = user.length() == 3 ? "hsh00-" + user : user; - final String password = credentials.get(I18N.getText("password")); + final String password = credentials.get(I18N.getText("password", getLocale())); final String grantingTicket = ticketService.getGrantingTicket(loginUser, password); if (grantingTicket != null && !grantingTicket.isEmpty()) { feedback.setValue("successful login"); @@ -99,7 +100,7 @@ public class LoginWindow extends Window { } }); subContent.addComponent(okButton); - final Link linkToOld = new Link(I18N.getText("main.panel.link_to_old"), new ExternalResource("https://admin.hostsharing.net/hsarweb")); + final Link linkToOld = new Link(I18N.getText("main.panel.link_to_old", getLocale()), new ExternalResource("https://admin.hostsharing.net/hsarweb")); subContent.addComponent(linkToOld); setContent(subContent); diff --git a/web/src/main/java/de/hsadmin/web/MainPanel.java b/web/src/main/java/de/hsadmin/web/MainPanel.java index a7fa611..4c5d605 100644 --- a/web/src/main/java/de/hsadmin/web/MainPanel.java +++ b/web/src/main/java/de/hsadmin/web/MainPanel.java @@ -10,8 +10,8 @@ public class MainPanel extends CustomComponent{ private static final long serialVersionUID = -1085100738394404620L; public MainPanel() { - final String helpBaseURL = I18N.getText("help.baseurl"); - final Component helpContent = new BrowserFrame(I18N.getText("main.panel.title"), new ExternalResource(helpBaseURL + "hsadmin")); + final String helpBaseURL = I18N.getText("help.baseurl", getLocale()); + final Component helpContent = new BrowserFrame(I18N.getText("main.panel.title", getLocale()), new ExternalResource(helpBaseURL + "hsadmin")); helpContent.setSizeFull(); setCompositionRoot(helpContent); setSizeFull(); diff --git a/web/src/main/java/de/hsadmin/web/MainToolbar.java b/web/src/main/java/de/hsadmin/web/MainToolbar.java index 85458f5..ad2ceff 100644 --- a/web/src/main/java/de/hsadmin/web/MainToolbar.java +++ b/web/src/main/java/de/hsadmin/web/MainToolbar.java @@ -52,7 +52,7 @@ public class MainToolbar extends CustomComponent implements ClickListener { final Button btn = new Button(); btn.setId(name + "-btn"); btn.setIcon(new ThemeResource("../icons/" + icon + "-icon.png")); - btn.setDescription(I18N.getText(name + ".tooltip")); + btn.setDescription(I18N.getText(name + ".tooltip", getLocale())); btn.setStyleName("borderless"); btn.addClickListener(this); return btn; diff --git a/web/src/main/java/de/hsadmin/web/PackagePanel.java b/web/src/main/java/de/hsadmin/web/PackagePanel.java index 5f92a76..de660e4 100644 --- a/web/src/main/java/de/hsadmin/web/PackagePanel.java +++ b/web/src/main/java/de/hsadmin/web/PackagePanel.java @@ -31,23 +31,23 @@ public class PackagePanel extends CustomComponent implements IHSPanel, SelectedT { final TabSheet tabsheet = new TabSheet(); tabsheet.addSelectedTabChangeListener(this); - tabsheet.addTab(new GenericForm("pac", session, itemId, "name"), I18N.getText("pac")); + tabsheet.addTab(new GenericForm("pac", session, itemId, "name"), I18N.getText("pac", getLocale())); final HSTab usersTab = new HSTab("user", session, "pac", itemId, "name"); usersTab.fillTable(); - tabsheet.addTab(usersTab, I18N.getText("user")); + tabsheet.addTab(usersTab, I18N.getText("user", getLocale())); final HSTab aliasTab = new HSTab("emailalias", session, "pac", itemId, "name"); - tabsheet.addTab(aliasTab, I18N.getText("emailalias")); + tabsheet.addTab(aliasTab, I18N.getText("emailalias", getLocale())); final HSTab domainTab = new HSTab("domain", session, "pac", itemId, "name"); - tabsheet.addTab(domainTab, I18N.getText("domain")); + tabsheet.addTab(domainTab, I18N.getText("domain", getLocale())); final HSTab mysqluserTab = new HSTab("mysqluser", session, "pac", itemId, "name"); - tabsheet.addTab(mysqluserTab, I18N.getText("mysqluser")); + tabsheet.addTab(mysqluserTab, I18N.getText("mysqluser", getLocale())); final HSTab mysqldbTab = new HSTab("mysqldb", session, "pac", itemId, "name"); - tabsheet.addTab(mysqldbTab, I18N.getText("mysqldb")); + tabsheet.addTab(mysqldbTab, I18N.getText("mysqldb", getLocale())); final HSTab postgresqluserTab = new HSTab("postgresqluser", session, "pac", itemId, "name"); - tabsheet.addTab(postgresqluserTab, I18N.getText("postgresqluser")); + tabsheet.addTab(postgresqluserTab, I18N.getText("postgresqluser", getLocale())); final HSTab postgresqldbTab = new HSTab("postgresqldb", session, "pac", itemId, "name"); - tabsheet.addTab(postgresqldbTab, I18N.getText("postgresqldb")); + tabsheet.addTab(postgresqldbTab, I18N.getText("postgresqldb", getLocale())); return tabsheet; } diff --git a/web/src/main/java/de/hsadmin/web/PanelToolbar.java b/web/src/main/java/de/hsadmin/web/PanelToolbar.java index 9fb9645..46d7a55 100644 --- a/web/src/main/java/de/hsadmin/web/PanelToolbar.java +++ b/web/src/main/java/de/hsadmin/web/PanelToolbar.java @@ -60,7 +60,7 @@ public class PanelToolbar extends HorizontalLayout implements ClickListener { if (image != null) { btn.setIcon(new ThemeResource("../icons/" + image + "-icon.png")); } - btn.setDescription(I18N.getText(tooltip)); + btn.setDescription(I18N.getText(tooltip, getLocale())); btn.setStyleName("borderless"); btn.addClickListener(this); return btn; @@ -88,7 +88,7 @@ public class PanelToolbar extends HorizontalLayout implements ClickListener { final Object value = parent.getSelection(); if (value == null) { if (ACTION_EDIT.equals(action) || ACTION_DELETE.equals(action)) { - UI.getCurrent().addWindow(new InfoWindow(I18N.getText("emptySelectionMessage") + " " + action)); + UI.getCurrent().addWindow(new InfoWindow(I18N.getText("emptySelectionMessage", getLocale()) + " " + action)); return; } } diff --git a/web/src/main/java/de/hsadmin/web/UserProfileWindow.java b/web/src/main/java/de/hsadmin/web/UserProfileWindow.java index cec28f2..33c279a 100644 --- a/web/src/main/java/de/hsadmin/web/UserProfileWindow.java +++ b/web/src/main/java/de/hsadmin/web/UserProfileWindow.java @@ -5,6 +5,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -28,7 +29,9 @@ public class UserProfileWindow extends Window implements IHSWindow { public UserProfileWindow(final HSAdminSession session, final Map whereContext) { - super(I18N.getText("edit") + " " + I18N.getText("user")); + super(); + final Locale locale = getLocale(); + setCaption(I18N.getText("edit", locale) + " " + I18N.getText("user", locale)); center(); setModal(true); setWidth("640px");