Skip to content

Commit

Permalink
Update LanguageService.java (#992)
Browse files Browse the repository at this point in the history
Update LanguageService.java
_ Handle GUI test
  • Loading branch information
nhthinh-axonivy authored Aug 28, 2024
1 parent 0ade5ec commit 22ef594
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public IvyLanguage getIvyLanguageOfUser() {
}

public String getUserLanguage() {
return loadLanguage(IUser::getLanguage);
String languageTag = loadLanguage(IUser::getLanguage);
if (languageTag == StringUtils.EMPTY) {
return getDefaultLanguage().toLanguageTag();
}
return languageTag;
}

public String getUserFormatLanguage() {
Expand All @@ -75,9 +79,7 @@ private String loadLanguage(Function<IUser, Locale> userLocaleLoader) {
} else {
Locale apply = userLocaleLoader.apply(Ivy.session().getSessionUser());
languageTag = Objects.nonNull(apply) ? apply.toLanguageTag() : languageTag;
if (languageTag == StringUtils.EMPTY) {
return getDefaultLanguage().toLanguageTag();
}

}
return languageTag;
}
Expand Down

0 comments on commit 22ef594

Please sign in to comment.