Engineering
i18n avatar

i18n

LobeHub i18n assistant for managing react-i18next translations, key naming, and localization workflows.

Introduction

The i18n assistant is a specialized tool designed to streamline the localization process for the LobeHub ecosystem. It enforces strict development standards to ensure consistency, maintainability, and scalability of localized text across the application. By integrating directly with the react-i18next framework, it provides clear guidance on managing language files, implementing translation keys, and adhering to the project's specific architectural patterns.

  • Standardizes flat key naming conventions using dot notation (e.g., feature.context.action) to prevent collisions and improve clarity.

  • Manages translation workflows by guiding developers through adding keys to specific namespace files in src/locales/default/.

  • Provides syntax guidance for using react-i18next hooks like useTranslation in .tsx components.

  • Enforces strict constraints regarding file editing, emphasizing that only default locale source files should be modified, while auto-generated JSON files remain strictly for the build process.

  • Supports advanced i18n features such as parameter interpolation using the {{variableName}} syntax.

  • Use this assistant when implementing new features to ensure all user-facing strings are correctly abstracted into the i18n system.

  • Always refer to the namespace list (common, chat, setting, etc.) to ensure translations are grouped logically.

  • Remember to trigger the pnpm i18n generation script before submitting pull requests to ensure consistent synchronization across language locales.

  • Avoid nesting objects in translation files; use the prescribed flat structure to maintain schema stability.

  • Consult this tool when encountering issues with translation key conflicts or when integrating complex variables into localized strings.

Repository Stats

Stars
75,828
Forks
15,036
Open Issues
740
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 09:02 AM
View on GitHub