Skip to content

[studio][i18n] Extend translation keys & add useLanguage compatible alias in LangContext#433

Open
zhaohai666 wants to merge 3 commits into
apache:rocketmq-studiofrom
zhaohai666:feature/studio-i18n-language-context
Open

[studio][i18n] Extend translation keys & add useLanguage compatible alias in LangContext#433
zhaohai666 wants to merge 3 commits into
apache:rocketmq-studiofrom
zhaohai666:feature/studio-i18n-language-context

Conversation

@zhaohai666

Copy link
Copy Markdown

Summary

This PR enriches i18n translation resources and provides a compatible language hook alias to facilitate component migration from frontend-new to the new web frontend.
Branch: feature/studio-i18n-language-context
Commit: 8b49561, 2 files changed, +426 lines

Close #【Related Issue】

Changes

1. LangContext.tsx

  • Export useLanguage as a compatible alias of existing useLang hook
  • Support components migrated from frontend-new which reference useLanguage without modification

2. translations.ts

Expand translation entries from 344 lines to 763 lines, adding 400+ new translation keys covering multiple business modules.
All keys adopt dot-separated namespace specification and are migrated from the uppercase underscore format used in frontend-new:

  • login.*: Login page (11 keys)
  • ops.*: Operations page (4 keys)
  • topic.*: Topic management (30 keys)
  • group.*: Consumer group management (40 keys)
  • message.*: Message query (25 keys)
  • dlq.*: Dead letter queue (3 keys)
  • trace.*: Message trace (5 keys)
  • broker.*: Broker details (25 keys)
  • proxy.*: Proxy cluster management (20 keys)
  • ssl.*: SSL configuration (30 keys)
  • ns.*: Namespace management (30 keys)
  • alert.*: Alert management (30 keys)
  • liteTopic.*: LiteTopic management (35 keys)
  • producer.*: Producer related (2 keys)
  • common.*: Extended general common labels (40+ keys)

Purpose

  1. Complete i18n text resource preparation for subsequent page migration from legacy frontend-new
  2. Reduce modification cost of migrated components via useLanguage compatibility alias
  3. Unify translation key naming standard to dot-separated namespace format for long-term maintenance

Verification

  • Hook compatibility verified: both useLang and useLanguage work normally
  • All newly added translation keys follow unified naming convention
  • No duplicate or invalid key entries introduced

…omprehensive translation keys

- Add useLanguage as compatibility alias for useLang in LangContext.tsx
- Add 400+ translation keys to translations.ts covering:
  - Login, Ops, Topic, Group/Consumer, Message, DLQ, Message Trace
  - Broker detail, Proxy cluster, SSL settings, Namespace
  - Alert management, LiteTopic, Producer
  - Extended common keys
- All keys follow dot-notation convention (e.g., topic.name, group.count)
- Keys mapped from frontend-new uppercase underscore format to dot-namespace format
@zhaohai666
zhaohai666 force-pushed the feature/studio-i18n-language-context branch from 2c4b553 to ade82a1 Compare July 16, 2026 06:36
- Remove duplicate 'common.export' and 'common.searchPlaceholder' keys in translations.ts
- Use defineConfig from vitest/config instead of vite for test property types
- Add vitest/globals type reference in test/setup.ts for beforeEach
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.

1 participant