Principle:Langgenius Dify Internationalization
| Knowledge Sources | Dify |
|---|---|
| Domains | Frontend, Internationalization |
| Last Updated | 2026-02-12 07:00 GMT |
Overview
Multi-language support using i18next with 23 supported locales, locale-aware formatting, and i18n validation tooling, ensuring the Dify interface is accessible to a global user base.
Description
The Internationalization principle governs how Dify supports multiple languages and locale-sensitive formatting across its frontend application. Built on i18next, the internationalization system provides translation management, interpolation, pluralization, and namespace-based organization of translation keys. With 23 supported locales, the system covers a broad range of languages and regional variants.
In the Dify codebase, internationalization touches multiple layers. The root layout determines the active locale and configures the HTML language attribute. An i18n context provider makes translation functions available throughout the component tree. Format utilities handle locale-aware number, date, and currency formatting. Translation data is organized into namespace-separated JSON files under the i18n directory. Dedicated validation tooling (check-i18n and analyze-i18n-diff scripts) ensures that translation files remain complete and consistent across all supported locales, catching missing keys before they reach production.
This principle matters because Dify serves a global community of developers and organizations building LLM applications. Incomplete or inconsistent translations degrade the user experience and can create confusion in critical workflows like model configuration or dataset management. The validation tooling catches regressions early, while the namespace-based organization allows different teams to manage translations for their respective feature areas without merge conflicts.
Usage
Use this principle when:
- Adding new user-facing strings to any frontend component
- Introducing support for a new locale or language variant
- Modifying date, number, or currency formatting that must respect locale conventions
Theoretical Basis
Internationalization (i18n) follows the principle of separation of content from code, where translatable strings are externalized into resource files that can be independently managed by translators. The i18next framework implements the ICU MessageFormat conventions for handling pluralization, gender, and other locale-dependent grammar rules. Namespace partitioning follows the module boundary pattern, aligning translation files with feature areas to support independent development and deployment.
Related Pages
- Implementation:Langgenius_Dify_Root_Layout
- Implementation:Langgenius_Dify_I18n_Context
- Implementation:Langgenius_Dify_Format_Utils
- Implementation:Langgenius_Dify_I18n_Translation_Data
- Implementation:Langgenius_Dify_Timezone_Data
- Implementation:Langgenius_Dify_Check_I18n
- Implementation:Langgenius_Dify_Analyze_I18n_Diff