miantalha45 opened a new pull request, #4006:
URL: https://github.com/apache/hertzbeat/pull/4006
## Description
Fixes the issue where the theme settings drawer displayed Chinese text
even when the application language was set to English or other languages.
## Changes
- Created `SettingDrawerI18nDirective` to dynamically translate hardcoded
Chinese text in the `@delon/theme/setting-drawer` component
- The directive loads translations from i18n JSON files and replaces text in
the DOM
- Added translations for all setting drawer text in all supported languages
(en-US, zh-CN, zh-TW, ja-JP, pt-BR)
- Added comprehensive test cases for the directive
- Registered the directive in LayoutModule and applied it to the
setting-drawer component
## Technical Details
- The `@delon/theme/setting-drawer` component has hardcoded Chinese text
that doesn't support i18n
- Solution uses a custom Angular directive that:
1. Dynamically loads all translations from i18n JSON files
2. Builds a reverse mapping (text → translation key)
3. Replaces text in the DOM when language changes
4. Handles special cases like the info message that may be split across
multiple text nodes
## Testing
- Added unit tests for the directive
- Tested manually in the application with all supported languages
- Verified text replacement works correctly for all setting drawer labels
## Related Issue
Fixes #4004
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]