Alexander Wels has uploaded a new change for review. Change subject: webadmin: Select english when browser is other locale ......................................................................
webadmin: Select english when browser is other locale - Fixed ability to select English (which was default) when the browser default was a different locale. Selecting English would reset to the browsers default locale. Change-Id: Id1b31fe65c306602c45c85857ccc7392e16dc8d3 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=894288 Signed-off-by: Alexander Wels <aw...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractLoginPopupView.java M frontend/webadmin/modules/userportal-gwtp/pom.xml M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/userportal/UserPortal.gwt.xml M frontend/webadmin/modules/webadmin/pom.xml M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml 5 files changed, 13 insertions(+), 14 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/11047/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractLoginPopupView.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractLoginPopupView.java index 0eb8cd32..0ed7eea 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractLoginPopupView.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractLoginPopupView.java @@ -23,6 +23,7 @@ * TODO: check if bigger portion of the LoginPopupView can not be moved to this class */ public abstract class AbstractLoginPopupView extends AbstractPopupView<DialogBoxWithKeyHandlers> { + private static final String DEFAULT = "default"; //$NON-NLS-1$ @UiField(provided = true) @Ignore @@ -57,15 +58,13 @@ String[] localeNames = LocaleInfo.getAvailableLocaleNames(); for (String localeName : localeNames) { - String nativeName = LocaleInfo.getLocaleNativeDisplayName(localeName); - if (localeName.equals("default")) { //$NON-NLS-1$ - nativeName = "English"; //$NON-NLS-1$ - } - - localeBox.addItem(nativeName, localeName); - if (localeName.equals(currentLocale)) { - localeBox.setSelectedIndex(localeBox.getItemCount() - 1); - selectedLocale.setText(localeBox.getItemText(localeBox.getSelectedIndex())); + if(!DEFAULT.equals(localeName)) { + String nativeName = LocaleInfo.getLocaleNativeDisplayName(localeName); + localeBox.addItem(nativeName, localeName); + if (localeName.equals(currentLocale)) { + localeBox.setSelectedIndex(localeBox.getItemCount() - 1); + selectedLocale.setText(localeBox.getItemText(localeBox.getSelectedIndex())); + } } } @@ -79,7 +78,7 @@ String localeName = localeBox.getValue(localeBox.getSelectedIndex()); String localeString = ""; //$NON-NLS-1$ - if (!localeName.equals("default")) { //$NON-NLS-1$ + if (!DEFAULT.equals(localeName)) { localeString = "?locale=" + localeName; //$NON-NLS-1$ } Window.open(FrontendUrlUtils.getCurrentPageURL() + localeString, "_self", ""); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/frontend/webadmin/modules/userportal-gwtp/pom.xml b/frontend/webadmin/modules/userportal-gwtp/pom.xml index 96e8229..2d8ff03 100644 --- a/frontend/webadmin/modules/userportal-gwtp/pom.xml +++ b/frontend/webadmin/modules/userportal-gwtp/pom.xml @@ -334,7 +334,7 @@ <profile> <id>all-langs</id> <properties> - <gwt.locale>default,es,fr,ja,pt_BR,zh_CN</gwt.locale> + <gwt.locale>default,en,es,fr,ja,pt_BR,zh_CN</gwt.locale> </properties> </profile> </profiles> diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/userportal/UserPortal.gwt.xml b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/userportal/UserPortal.gwt.xml index 152efcf..0d1704d 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/userportal/UserPortal.gwt.xml +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/userportal/UserPortal.gwt.xml @@ -38,7 +38,7 @@ <set-configuration-property name="locale.useragent" value="Y" /> <!-- Supported locales (defined via maven property) --> - <extend-property name="locale" values="es,fr,ja,pt_BR,zh_CN" /> + <extend-property name="locale" values="en,es,fr,ja,pt_BR,zh_CN" /> <set-property name="locale" value="${gwt.locale}" /> </module> diff --git a/frontend/webadmin/modules/webadmin/pom.xml b/frontend/webadmin/modules/webadmin/pom.xml index 0ce5e74..967f67f 100644 --- a/frontend/webadmin/modules/webadmin/pom.xml +++ b/frontend/webadmin/modules/webadmin/pom.xml @@ -334,7 +334,7 @@ <profile> <id>all-langs</id> <properties> - <gwt.locale>default,es,fr,ja,pt_BR,zh_CN</gwt.locale> + <gwt.locale>default,en,es,fr,ja,pt_BR,zh_CN</gwt.locale> </properties> </profile> </profiles> diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml index c82d658..884f150 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml @@ -38,7 +38,7 @@ <set-configuration-property name="locale.useragent" value="Y" /> <!-- Supported locales (defined via maven property) --> - <extend-property name="locale" values="es,fr,ja,pt_BR,zh_CN" /> + <extend-property name="locale" values="en,es,fr,ja,pt_BR,zh_CN" /> <set-property name="locale" value="${gwt.locale}" /> </module> -- To view, visit http://gerrit.ovirt.org/11047 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1b31fe65c306602c45c85857ccc7392e16dc8d3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alexander Wels <aw...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches