Principle:Langgenius Dify Documentation Localization
| Knowledge Sources | Dify |
|---|---|
| Domains | Frontend, Documentation, Internationalization |
| Last Updated | 2026-02-12 07:00 GMT |
Overview
Documentation Localization is the principle of generating locale-aware documentation URLs that point users to help resources translated into their preferred language.
Description
Dify is an internationally used platform with documentation available in multiple languages. The Documentation Localization principle ensures that when the application links users to external documentation, help articles, or API references, the URLs are constructed to direct users to the version matching their current locale setting. This avoids the frustrating experience of being sent to documentation in a language the user cannot read.
In the Dify frontend, this principle is implemented through the internationalization context, which provides the current locale and exposes utility functions for generating localized URLs. When components need to link to documentation pages, they use these utilities rather than hardcoding URLs, ensuring that a user operating in Chinese is directed to Chinese documentation while an English user sees English documentation. The URL generation logic handles locale-to-documentation-path mapping, including fallback behavior when a particular page has not been translated.
This principle matters because documentation is a critical part of the user experience for a developer platform like Dify. Users frequently consult documentation while building applications, configuring integrations, or troubleshooting issues. Delivering documentation in the correct language significantly reduces friction and improves the platform's accessibility to a global audience.
Usage
Use this principle when:
- Adding documentation links or help references to UI components
- Implementing tooltip help text that links to detailed documentation
- Building onboarding flows that reference getting-started guides
Theoretical Basis
This principle extends Content Negotiation from HTTP protocol design to the application layer. Just as HTTP content negotiation allows servers to deliver resources in the client's preferred language, documentation localization applies the same concept to outbound links within the application. It follows the Internationalization (i18n) best practice of separating locale-specific content from application logic, ensuring that localization decisions are made consistently through a centralized mechanism.