添加国际化支持,集成i18next库,新增语言切换器组件,更新多个页面以支持多语言显示。更新package.json以包含相关依赖,并在应…#62
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#57
This pull request introduces internationalization (i18n) support to the application by integrating
i18nextand refactoring UI components to dynamically adapt to language changes. Additionally, it includes structural improvements to the navigation and menu components usinguseMemofor performance optimization. Below are the key changes:Internationalization (i18n) Integration:
i18next,react-i18next, andi18next-browser-languagedetectordependencies to the project (lobe/package.json).Suspensefallback titles inlobe/src/App.tsxto use translations (e.g.,t('pageTitle.loading.panel')) for dynamic language support.useTranslationhook in various components (e.g.,DesktopPage,LayoutPage, andNav) to enable translated text for UI elements like buttons, menus, and headers. [1] [2] [3]Navigation and Menu Refactoring:
DesktopPageandNavwith dynamically generated items usinguseMemoto reflect language changes and improve performance. [1] [2] [3]LanguageSwitchercomponent to allow users to switch languages directly from the navigation bar. [1] [2]Structural Enhancements:
DesktopPageandLayoutPagecomponents to include dropdown menus and buttons with translated labels (e.g., "Enter System" and "Register"). [1] [2]useMemo-based approach for dropdown menu items inLayoutPageto ensure efficient re-rendering when the language changes.Configuration and Guidelines:
lobe/.cursor/rules/all.mdc) outlining design principles, task analysis, and quality criteria for UI design. This serves as a blueprint for consistent and professional UI development.