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 91966a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%--
~ Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
~ Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com).
~
~ WSO2 LLC. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
Expand Down 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
@@ -1,5 +1,5 @@
<%--
~ Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
~ Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com).
~
~ WSO2 LLC. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
Expand Down 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 91966a1

Please sign in to comment.