Author: surajk
Date: Fri Sep 14 13:45:26 2018 New Revision: 1840926 URL: http://svn.apache.org/viewvc?rev=1840926&view=rev Log: Improved: Arranged passport UI labels in alphabetic order. (OFBIZ-7285) Modified: ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java Modified: ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml?rev=1840926&r1=1840925&r2=1840926&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml (original) +++ ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml Fri Sep 14 13:45:26 2018 @@ -18,77 +18,75 @@ specific language governing permissions under the License. --> -<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <property key="PassportApplication"> - <value xml:lang="en">Passport Third Party Auth Application</value> - <value xml:lang="zh">第ä¸æ¹è®¤è¯åºç¨ç¨åº</value> +<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd"> + <!-- GitHub labels --> + <property key="GitHubFailedToMatchState"> + <value xml:lang="en">Failed to match the state parameter in GitHub response. Just try to login again.</value> + <value xml:lang="zh">GitHubååºä¸çstateåæ°ä¸ä¸è´ãéè¯ç»å½å³å¯ã</value> </property> - <property key="ThirdPartyLogin"> - <value xml:lang="en">Third Party Login</value> - <value xml:lang="zh">第ä¸æ¹ç»å½</value> + <property key="GitHubGetAuthorizationCodeError"> + <value xml:lang="en">Failed to get GitHub authorization code.</value> + <value xml:lang="zh">è·åGitHubææç æ¶åºéã</value> </property> - - <!-- LinkedIn labels --> - <property key="LinkedInFailedToMatchState"> - <value xml:lang="en">Failed to match the state parameter in LinkedIn response. Just try to login again.</value> - <value xml:lang="zh">é¢è±ååºä¸çstateåæ°ä¸ä¸è´ãéè¯ç»å½å³å¯ã</value> + <property key="GitHubGetOAuth2AccessTokenError"> + <value xml:lang="en">Failed to get GitHub access token: ${error}</value> + <value xml:lang="zh">è·åGitHub访é®ä»¤çæ¶åºéï¼${error}</value> </property> - <property key="RedirectToLinkedInOAuth2NullException"> - <value xml:lang="en">Error while redirecting to LinkedIn authorization URL. Please use other login method for now.</value> - <value xml:lang="zh">转å°é¢è±è®¤è¯ç½åæ¶åºéã请å 使ç¨å ¶å®ç»å½æ¹å¼ã</value> + <property key="GitHubGetOAuth2ConfigError"> + <value xml:lang="en">Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured.</value> + <value xml:lang="zh">è·åGitHubé ç½®æ¶åºéã请æ£æ¥OAuth2GitHubå®ä½ä¸æ¯å¦é ç½®äºä½ çåºéºæ è¯(productStoreId)ã</value> </property> - <property key="RedirectToLinkedInOAuth2Error"> - <value xml:lang="en">Error while redirecting to LinkedIn authorization URL: ${errorMessage}</value> - <value xml:lang="zh">转å°é¢è±è®¤è¯ç½åæ¶åºéï¼${errorMessage}ã</value> + <property key="GitHubGetOAuth2Error"> + <value xml:lang="en">Failed to get OAuth2GitHub entity: ${errorMessage}</value> + <value xml:lang="zh">è·åOAuth2GitHubå®ä½æ¶åºéï¼${errorMessage}</value> + </property> + <property key="GitHubRedirectToOAuth2Error"> + <value xml:lang="en">Error while redirecting to GitHub authorization URL: ${errorMessage}</value> + <value xml:lang="zh">转å°GitHub认è¯ç½åæ¶åºéï¼${errorMessage}ã</value> + </property> + <property key="GitHubRedirectToOAuth2NullException"> + <value xml:lang="en">Error while redirecting to GitHub authorization URL. Please use other login method for now.</value> + <value xml:lang="zh">转å°GitHub认è¯ç½åæ¶åºéã请å 使ç¨å ¶å®ç»å½æ¹å¼ã</value> </property> - <property key="FailedToGetLinkedInAuthorizationCode"> + <!-- LinkedIn labels --> + <property key="LinkedInFailedToGetAuthorizationCode"> <value xml:lang="en">Failed to get LinkedIn authorization code.<br>Error: ${error}<br>Error description: ${error_description}</value> <value xml:lang="zh">è·åé¢è±ææç æ¶åºéã<br>é误: ${error}<br>é误æè¿°: ${error_description}</value> </property> - <property key="GetLinkedInAuthorizationCodeError"> + <property key="LinkedInFailedToMatchState"> + <value xml:lang="en">Failed to match the state parameter in LinkedIn response. Just try to login again.</value> + <value xml:lang="zh">é¢è±ååºä¸çstateåæ°ä¸ä¸è´ãéè¯ç»å½å³å¯ã</value> + </property> + <property key="LinkedInGetAuthorizationCodeError"> <value xml:lang="en">Failed to get LinkedIn authorization code.</value> <value xml:lang="zh">è·åé¢è±ææç æ¶åºéã</value> </property> - <property key="GetOAuth2LinkedInConfigError"> - <value xml:lang="en">Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured.</value> - <value xml:lang="zh">è·åé¢è±é ç½®æ¶åºéã请æ£æ¥OAuth2LinkedInå®ä½ä¸æ¯å¦é ç½®äºä½ çåºéºæ è¯(productStoreId)ã</value> - </property> - <property key="GetOAuth2LinkedInAccessTokenError"> + <property key="LinkedInGetOAuth2AccessTokenError"> <value xml:lang="en">Failed to get LinkedIn access token.</value> <value xml:lang="zh">è·åé¢è±è®¿é®ä»¤çæ¶åºéã</value> </property> - <property key="GetOAuth2LinkedInError"> + <property key="LinkedInGetOAuth2ConfigError"> + <value xml:lang="en">Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured.</value> + <value xml:lang="zh">è·åé¢è±é ç½®æ¶åºéã请æ£æ¥OAuth2LinkedInå®ä½ä¸æ¯å¦é ç½®äºä½ çåºéºæ è¯(productStoreId)ã</value> + </property> + <property key="LinkedInGetOAuth2Error"> <value xml:lang="en">Failed to get OAuth2LinkedIn entity: ${errorMessage}</value> <value xml:lang="zh">è·åOAuth2LinkedInå®ä½æ¶åºéï¼${errorMessage}</value> </property> - - <!-- GitHub labels --> - <property key="RedirectToGitHubOAuth2NullException"> - <value xml:lang="en">Error while redirecting to GitHub authorization URL. Please use other login method for now.</value> - <value xml:lang="zh">转å°GitHub认è¯ç½åæ¶åºéã请å 使ç¨å ¶å®ç»å½æ¹å¼ã</value> - </property> - <property key="RedirectToGitHubOAuth2Error"> - <value xml:lang="en">Error while redirecting to GitHub authorization URL: ${errorMessage}</value> - <value xml:lang="zh">转å°GitHub认è¯ç½åæ¶åºéï¼${errorMessage}ã</value> - </property> - <property key="GitHubFailedToMatchState"> - <value xml:lang="en">Failed to match the state parameter in GitHub response. Just try to login again.</value> - <value xml:lang="zh">GitHubååºä¸çstateåæ°ä¸ä¸è´ãéè¯ç»å½å³å¯ã</value> - </property> - <property key="GetGitHubAuthorizationCodeError"> - <value xml:lang="en">Failed to get GitHub authorization code.</value> - <value xml:lang="zh">è·åGitHubææç æ¶åºéã</value> + <property key="LinkedInRedirectToOAuth2Error"> + <value xml:lang="en">Error while redirecting to LinkedIn authorization URL: ${errorMessage}</value> + <value xml:lang="zh">转å°é¢è±è®¤è¯ç½åæ¶åºéï¼${errorMessage}ã</value> </property> - <property key="GetOAuth2GitHubConfigError"> - <value xml:lang="en">Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured.</value> - <value xml:lang="zh">è·åGitHubé ç½®æ¶åºéã请æ£æ¥OAuth2GitHubå®ä½ä¸æ¯å¦é ç½®äºä½ çåºéºæ è¯(productStoreId)ã</value> + <property key="LinkedInRedirectToOAuth2NullException"> + <value xml:lang="en">Error while redirecting to LinkedIn authorization URL. Please use other login method for now.</value> + <value xml:lang="zh">转å°é¢è±è®¤è¯ç½åæ¶åºéã请å 使ç¨å ¶å®ç»å½æ¹å¼ã</value> </property> - <property key="GetOAuth2GitHubAccessTokenError"> - <value xml:lang="en">Failed to get GitHub access token: ${error}</value> - <value xml:lang="zh">è·åGitHub访é®ä»¤çæ¶åºéï¼${error}</value> + <property key="PassportApplication"> + <value xml:lang="en">Passport Third Party Auth Application</value> + <value xml:lang="zh">第ä¸æ¹è®¤è¯åºç¨ç¨åº</value> </property> - <property key="GetOAuth2GitHubError"> - <value xml:lang="en">Failed to get OAuth2GitHub entity: ${errorMessage}</value> - <value xml:lang="zh">è·åOAuth2GitHubå®ä½æ¶åºéï¼${errorMessage}</value> + <property key="ThirdPartyLogin"> + <value xml:lang="en">Third Party Login</value> + <value xml:lang="zh">第ä¸æ¹ç»å½</value> </property> </resource> Modified: ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java?rev=1840926&r1=1840925&r2=1840926&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java (original) +++ ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java Fri Sep 14 13:45:26 2018 @@ -114,12 +114,12 @@ public class GitHubEvents { Debug.logInfo("Request to GitHub: " + redirectUrl, module); response.sendRedirect(redirectUrl); } catch (NullPointerException e) { - String errMsg = UtilProperties.getMessage(resource, "RedirectToGitHubOAuth2NullException", UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "GitHubRedirectToOAuth2NullException", UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } catch (IOException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString()); - String errMsg = UtilProperties.getMessage(resource, "RedirectToGitHubOAuth2Error", messageMap, UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "GitHubRedirectToOAuth2Error", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -147,7 +147,7 @@ public class GitHubEvents { try { errMsg = UtilProperties.getMessage(resource, "FailedToGetGitHubAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request)); } catch (UnsupportedEncodingException e) { - errMsg = UtilProperties.getMessage(resource, "GetGitHubAuthorizationCodeError", UtilHttp.getLocale(request)); + errMsg = UtilProperties.getMessage(resource, "GitHubGetAuthorizationCodeError", UtilHttp.getLocale(request)); } request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; @@ -156,7 +156,7 @@ public class GitHubEvents { GenericValue oauth2GitHub = getOAuth2GitHubConfig(request); if (UtilValidate.isEmpty(oauth2GitHub)) { - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubConfigError", UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2ConfigError", UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -198,7 +198,7 @@ public class GitHubEvents { // Debug.logInfo("Generated Access Token : " + accessToken, module); // Debug.logInfo("Token Type: " + tokenType, module); } else { - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubAccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -310,7 +310,7 @@ public class GitHubEvents { return getOAuth2GitHubConfig(delegator, productStoreId); } catch (GenericEntityException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString()); - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubError", messageMap, UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2Error", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); } return null; Modified: ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java?rev=1840926&r1=1840925&r2=1840926&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java (original) +++ ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java Fri Sep 14 13:45:26 2018 @@ -115,12 +115,12 @@ public class LinkedInEvents { + "&state=" + state; response.sendRedirect(redirectUrl); } catch (NullPointerException e) { - String errMsg = UtilProperties.getMessage(resource, "RedirectToLinkedInOAuth2NullException", UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "LinkedInRedirectToOAuth2NullException", UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } catch (IOException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString()); - String errMsg = UtilProperties.getMessage(resource, "RedirectToLinkedInOAuth2Error", messageMap, UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "LinkedInRedirectToOAuth2Error", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -146,9 +146,9 @@ public class LinkedInEvents { String errorDescpriton = request.getParameter(PassportUtil.COMMON_ERROR_DESCRIPTION); String errMsg = null; try { - errMsg = UtilProperties.getMessage(resource, "FailedToGetLinkedInAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request)); + errMsg = UtilProperties.getMessage(resource, "LinkedInFailedToGetAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request)); } catch (UnsupportedEncodingException e) { - errMsg = UtilProperties.getMessage(resource, "GetLinkedInAuthorizationCodeError", UtilHttp.getLocale(request)); + errMsg = UtilProperties.getMessage(resource, "LinkedInGetAuthorizationCodeError", UtilHttp.getLocale(request)); } request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; @@ -157,7 +157,7 @@ public class LinkedInEvents { GenericValue oauth2LinkedIn = getOAuth2LinkedInConfig(request); if (UtilValidate.isEmpty(oauth2LinkedIn)) { - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInConfigError", UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2ConfigError", UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -196,7 +196,7 @@ public class LinkedInEvents { accessToken = (String) userMap.get("access_token"); // Debug.logInfo("Generated Access Token : " + accessToken, module); } else { - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInAccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } @@ -317,7 +317,7 @@ public class LinkedInEvents { return getOAuth2LinkedInConfig(delegator, productStoreId); } catch (GenericEntityException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString()); - String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInError", messageMap, UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2Error", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); } return null; |
Free forum by Nabble | Edit this page |