Skip to content

Commit

Permalink
Fix localize OR and Username labels in Authentication Portal and Reco…
Browse files Browse the repository at this point in the history
…very Portal
  • Loading branch information
HasiniSama committed Aug 27, 2024
1 parent 9c69125 commit 06e2e4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
String i18nKey = null;
if (StringUtils.equals(attribute, USERNAME_CLAIM_URI)) {
i18nKey = "Username";
i18nKey = "username";
} else if (StringUtils.equals(attribute, EMAIL_CLAIM_URI )) {
i18nKey = "email";
} else if (StringUtils.equals(attribute, MOBILE_CLAIM_URI)) {
Expand All @@ -61,8 +61,9 @@
}
if (attributeList.size() > 0) {
String orString = AuthenticationEndpointUtil.i18n(resourceBundle, "or");
usernameLabel = String.join(", ", attributeList.subList(0, attributeList.size() - 1))
+ (attributeList.size() > 1 ? " or " : "")
+ (attributeList.size() > 1 ? " " + orString + " " : "")
+ attributeList.get(attributeList.size() - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
String i18nKey = null;
if (StringUtils.equals(attribute, USERNAME_CLAIM_URI)) {
i18nKey = "Username";
i18nKey = "username";
} else if (StringUtils.equals(attribute, EMAIL_CLAIM_URI )) {
i18nKey = "email";
} else if (StringUtils.equals(attribute, MOBILE_CLAIM_URI)) {
Expand All @@ -59,8 +59,9 @@
}
}
if (attributeList.size() > 0) {
String orString = AuthenticationEndpointUtil.i18n(resourceBundle, "or");
usernameLabel = String.join(", ", attributeList.subList(0, attributeList.size() - 1))
+ (attributeList.size() > 1 ? " or " : "")
+ (attributeList.size() > 1 ? " " + orString + " " : "")
+ attributeList.get(attributeList.size() - 1);
}
return usernameLabel;
Expand Down

0 comments on commit 06e2e4c

Please sign in to comment.