Skip to content

Conversation

@H-ario-m
Copy link
Contributor

This PR addresses issue #678 where error messages were always displayed in Chinese regardless of the selected language.

Changes Made:

  1. Error Message Localization (request.js):

    • Removed hardcoded Chinese error messages
    • Implemented proper i18n support using formatMessage
    • Added better error descriptions with URLs for debugging
    • Improved error handling structure
  2. Added Translations:

    • Added English and Chinese translations for all HTTP status codes (200-504)
    • Added translations for network errors
    • Added translations for login/authentication errors
    • Added translations for registration errors
    • Added generic error message templates
  3. Language Selection Improvements:

    • Added language persistence using localStorage in SelectLang
    • Optimized locale configuration in config.js
    • Enabled Ant Design's built-in localization
    • Enabled title localization

Testing Done:

  1. Tested error messages in both English and Chinese:
    • Login errors
    • Registration errors
    • Network errors
    • Various HTTP status code errors
  2. Verified language selection persists after page reload
  3. Confirmed error messages are properly formatted and include relevant details

Screenshots:
Screenshot From 2025-05-15 00-46-55
Screenshot From 2025-05-15 00-47-09
Screenshot From 2025-05-15 00-47-39
Screenshot From 2025-05-15 00-47-58

This implementation ensures a consistent user experience across languages and provides more informative error messages for better user understanding.

@yeasy yeasy requested a review from YoungHypo May 15, 2025 16:08
Copy link
Contributor

@YoungHypo YoungHypo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI check not passed

…request.js and BasicLayout.js - Remove unused imports - Combine duplicate imports - Improve error message handling - Fixes hyperledger-cello#678

Signed-off-by: Anshuman ojha <[email protected]>
@H-ario-m
Copy link
Contributor Author

CI check not passed

Fixed the error. Please review it

@H-ario-m H-ario-m requested a review from YoungHypo May 16, 2025 06:12
Copy link
Contributor

@YoungHypo YoungHypo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yeasy yeasy merged commit 1e54e05 into hyperledger-cello:main May 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants