Skip to content

I18n Module

Slug: i18n

Overview

Tower supports full internationalization with Chinese and English. All user-facing text in the application uses the t("key") translation function, ensuring consistent language coverage across every page and component. You can switch the language in Settings, and the change takes effect immediately without reloading the page.

Details

  • Dual language maintenance: Both Chinese (zh) and English (en) translation sets must be kept in sync. Adding a new UI string requires adding the key to both language files.
  • Key naming convention: Translation keys follow the format module.feature.description for clear organization and easy lookup.
  • Instant switching: Language changes apply immediately across the entire UI — no page reload or restart required.
  • Provider-based architecture: The i18n system uses a React Provider and hook pattern, making translations accessible from any component in the tree.

File Reference

Core Library (src/lib/i18n/)

i18n configuration and resource management.

Usage

  • src/lib/i18n.tsx -- i18n Provider and hook

Conventions

  • All user-visible text must be wrapped with t("key")
  • Both zh/en translation sets must be maintained simultaneously
  • Key naming format: module.feature.description