mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
PL-7113 Remember last used choosen language on web client
This commit is contained in:
parent
163b4af1b4
commit
887dd9707a
@ -199,11 +199,13 @@ public class LoginWindow extends UIView {
|
||||
}
|
||||
|
||||
protected Locale resolveLocale(App app) {
|
||||
String lastLocale = app.getCookieValue(COOKIE_LOCALE);
|
||||
if (lastLocale != null) {
|
||||
for (Locale locale : locales.values()) {
|
||||
if (locale.toLanguageTag().equals(lastLocale)) {
|
||||
return locale;
|
||||
if (globalConfig.getLocaleSelectVisible()) {
|
||||
String lastLocale = app.getCookieValue(COOKIE_LOCALE);
|
||||
if (lastLocale != null) {
|
||||
for (Locale locale : locales.values()) {
|
||||
if (locale.toLanguageTag().equals(lastLocale)) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -472,7 +474,9 @@ public class LoginWindow extends UIView {
|
||||
// locale could be set on the server
|
||||
if (connection.getSession() != null) {
|
||||
app.setLocale(connection.getSession().getLocale());
|
||||
app.addCookie(COOKIE_LOCALE, locale.toLanguageTag());
|
||||
if (globalConfig.getLocaleSelectVisible()) {
|
||||
app.addCookie(COOKIE_LOCALE, locale.toLanguageTag());
|
||||
}
|
||||
}
|
||||
} catch (LoginException e) {
|
||||
log.info("Login failed: " + e.toString());
|
||||
|
Loading…
Reference in New Issue
Block a user