feat: implement comprehensive i18n internationalization support

- Add custom i18n infrastructure with TypeScript support
- Support Chinese (zh-CN) and English (en-US) languages
- Implement language switching with localStorage persistence
- Update all components with translation keys:
  * System info components (board-info-panel, board-index)
  * Display management components (display-state-index, display-state-card)
  * LED strip configuration components (led-strip-configuration, led-count-control-panel)
  * White balance component with detailed usage instructions
  * LED test component with test pattern descriptions
- Add comprehensive translation coverage for:
  * Navigation menus and page titles
  * Common UI elements (buttons, status, actions)
  * Hardware information and connection status
  * Display configuration options
  * LED strip settings and controls
  * White balance adjustment instructions and tips
  * LED test modes and descriptions
  * Error messages and status indicators
- Features:
  * Dynamic language switching without app restart
  * Type-safe translation keys with full TypeScript support
  * Modular design for easy language extension
  * Responsive UI updates using SolidJS reactivity
This commit is contained in:
2025-07-08 16:55:12 +08:00
parent 4a3d7681d6
commit 2c6b777fa6
16 changed files with 893 additions and 115 deletions

View File

@ -1,5 +1,6 @@
import { Component, ParentComponent, createMemo } from 'solid-js';
import { BoardInfo } from '../../models/board-info.model';
import { useLanguage } from '../../i18n/index';
type ItemProps = {
label: string;
@ -15,6 +16,7 @@ const Item: ParentComponent<ItemProps> = (props) => {
};
export const BoardInfoPanel: Component<{ board: BoardInfo }> = (props) => {
const { t } = useLanguage();
const ttl = createMemo(() => {
if (props.board.connect_status !== 'Connected') {
return '--';
@ -60,10 +62,10 @@ export const BoardInfoPanel: Component<{ board: BoardInfo }> = (props) => {
<div class={statusBadgeClass()}>{connectStatus()}</div>
</div>
<div class="space-y-2">
<Item label="主机名">{props.board.host}</Item>
<Item label="IP地址">{props.board.address}</Item>
<Item label="端口">{props.board.port}</Item>
<Item label="延迟">{ttl()}</Item>
<Item label={t('info.hostname')}>{props.board.host}</Item>
<Item label={t('info.ipAddress')}>{props.board.address}</Item>
<Item label={t('info.port')}>{props.board.port}</Item>
<Item label={t('info.latency')}>{ttl()}</Item>
</div>
</div>
</div>