Implementation:Langgenius Dify Languages Catalog
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Internationalization, Locale Data |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Static, immutable catalog of all languages supported by the Dify platform, providing locale codes, display names, prompt names, example greetings, and support flags.
Description
The Languages Catalog is a const-asserted data module that defines the complete list of languages available in the Dify platform. Each language entry contains:
value-- The BCP 47 locale code (e.g.,en-US,zh-Hans,ja-JP).name-- The human-readable display name in the language's native script.prompt_name-- The English name used when constructing prompts for LLMs.example-- A greeting example in the language (e.g., "Hello, Dify!").supported-- A boolean flag indicating whether the language is currently enabled.
The catalog currently includes 22 languages: English, Simplified Chinese, Traditional Chinese, Portuguese (Brazil), Spanish, French, German, Japanese, Korean, Russian, Italian, Thai, Ukrainian, Vietnamese, Romanian, Polish, Hindi, Turkish, Farsi, Slovenian, Indonesian, and Tunisian Arabic. All languages are currently marked as supported: true.
The data is exported as a const assertion, providing precise literal types for TypeScript consumers.
Usage
This module is imported by language.ts to derive the list of supported locales and by other i18n utilities that need access to language metadata such as display names and prompt names.
Code Reference
Source Location
- Repository: Langgenius_Dify
- File: web/i18n-config/languages.ts
Signature
declare const data: {
readonly languages: readonly [
{ readonly value: 'en-US', readonly name: 'English (United States)', readonly prompt_name: 'English', readonly example: 'Hello, Dify!', readonly supported: true },
{ readonly value: 'zh-Hans', readonly name: '简体中文', readonly prompt_name: 'Chinese Simplified', ... },
// ... 20 more language entries
]
}
export default data
Import
import data from '@/i18n-config/languages'
const languages = data.languages
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | This is a static data module with no runtime inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| data.languages | readonly LanguageEntry[] |
Immutable array of 22 language definition objects |
| value | string |
BCP 47 locale code (e.g., "en-US") |
| name | string |
Native-script display name |
| prompt_name | string |
English name for LLM prompts |
| example | string |
Greeting example in the language |
| supported | boolean |
Whether the language is currently enabled |
Usage Examples
import data from '@/i18n-config/languages'
// Access all languages
const allLanguages = data.languages
console.log(allLanguages.length) // 22
// Find a specific language
const japanese = allLanguages.find(lang => lang.value === 'ja-JP')
console.log(japanese?.name) // '日本語 (日本)'
console.log(japanese?.prompt_name) // 'Japanese'
// Get supported language codes
const supportedCodes = allLanguages
.filter(lang => lang.supported)
.map(lang => lang.value)
// Use prompt name for LLM context
const promptName = allLanguages.find(l => l.value === 'fr-FR')?.prompt_name // 'French'
Related Pages
- Langgenius_Dify_Language_Config - Configuration module that imports and processes this catalog
- Langgenius_Dify_I18n_Server - Server-side i18n that uses the derived locale list