mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 04:07:42 +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) {
|
protected Locale resolveLocale(App app) {
|
||||||
String lastLocale = app.getCookieValue(COOKIE_LOCALE);
|
if (globalConfig.getLocaleSelectVisible()) {
|
||||||
if (lastLocale != null) {
|
String lastLocale = app.getCookieValue(COOKIE_LOCALE);
|
||||||
for (Locale locale : locales.values()) {
|
if (lastLocale != null) {
|
||||||
if (locale.toLanguageTag().equals(lastLocale)) {
|
for (Locale locale : locales.values()) {
|
||||||
return locale;
|
if (locale.toLanguageTag().equals(lastLocale)) {
|
||||||
|
return locale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -472,7 +474,9 @@ public class LoginWindow extends UIView {
|
|||||||
// locale could be set on the server
|
// locale could be set on the server
|
||||||
if (connection.getSession() != null) {
|
if (connection.getSession() != null) {
|
||||||
app.setLocale(connection.getSession().getLocale());
|
app.setLocale(connection.getSession().getLocale());
|
||||||
app.addCookie(COOKIE_LOCALE, locale.toLanguageTag());
|
if (globalConfig.getLocaleSelectVisible()) {
|
||||||
|
app.addCookie(COOKIE_LOCALE, locale.toLanguageTag());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (LoginException e) {
|
} catch (LoginException e) {
|
||||||
log.info("Login failed: " + e.toString());
|
log.info("Login failed: " + e.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user