Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Langgenius Dify I18n Translation Data

From Leeroopedia
Knowledge Sources
Domains Frontend, Internationalization, Localization
Last Updated 2026-02-12 07:00 GMT

Overview

Consolidated documentation for the Dify frontend internationalization (i18n) JSON translation files spanning all supported locales.

Description

The Dify frontend uses a flat JSON key-value structure for all user-facing string translations, stored under web/i18n/{locale}/ directories. The translation system covers the following locales:

  • en-US (English) - Primary/reference locale
  • fa-IR (Farsi/Persian)
  • fr-FR (French)
  • ro-RO (Romanian)
  • vi-VN (Vietnamese)
  • zh-Hant (Traditional Chinese)

Each locale directory contains multiple JSON files organized by feature domain (e.g., common.json, app.json, dataset.json, etc.). The common.json file is the largest and most broadly used, containing translations for:

  • Account management: Profile editing, email changes, password management, workspace settings, avatar handling, account deletion.
  • Navigation and menus: App menus (API Access, Logs, Monitoring, Orchestrate), dataset menus, user profile menus, settings.
  • Operations: CRUD labels (Add, Edit, Delete, Save, Cancel, Confirm, Copy, Download, Search, etc.).
  • Model provider settings: Model selection, API key management, load balancing, quota display, system model configuration.
  • Chat and conversation: Input placeholders, citation display, conversation naming, voice languages.
  • Data sources: Notion integration, website crawlers, connection status.
  • Members and roles: Team management, invitations, role assignment (owner, admin, editor, builder, normal, dataset_operator).
  • Tags and organization: Tag CRUD operations.
  • File upload: Size limits, error messages, format validation.
  • Theming: Light, dark, and system theme labels.
  • Compliance: GDPR, SOC 2, ISO 27001 labels.
  • API feedback: Success/failure action messages.

Key structure: All keys use dot-delimited namespaces (e.g., "account.changeEmail.title", "modelProvider.auth.addApiKey"). Values support ICU-style interpolation with Template:Variable placeholders and HTML-like tags (e.g., <email>Template:Email</email>).

Usage

These files are loaded by the i18n framework (likely next-intl or i18next) based on the user's interface_language setting. Developers must add new user-facing strings to web/i18n/en-US/ first, then ensure translations are provided for all other supported locales.

Code Reference

Source Location

Data Structure

{
  "namespace.key": "English translation text",
  "namespace.key2": "Text with {{variable}} interpolation",
  "namespace.nested.key": "Deeply namespaced text"
}

Import

// Typically consumed via the i18n framework:
import { useTranslation } from 'react-i18next'

const { t } = useTranslation('common')
const label = t('operation.save') // "Save"

I/O Contract

Inputs

Name Type Required Description
locale string Yes The user's selected interface language (e.g., 'en-US', 'zh-Hant')
namespace string Yes The translation file name (e.g., 'common', 'app', 'dataset')

Outputs

Name Type Description
translations Record<string, string> Flat key-value map of translation keys to localized strings

Locales Covered

Locale Code Language Notes
en-US English Primary reference locale
fa-IR Farsi (Persian) RTL language support
fr-FR French European French
ro-RO Romanian Romanian
vi-VN Vietnamese Vietnamese
zh-Hant Traditional Chinese Used in Taiwan, Hong Kong

Usage Examples

Using Translations in Components

import { useTranslation } from 'react-i18next'

function SaveButton() {
  const { t } = useTranslation('common')
  return <button>{t('operation.save')}</button>
}

Interpolated Strings

// JSON: "members.invitedAsRole": "Invited as {{role}} user"
t('members.invitedAsRole', { role: 'admin' })
// Output: "Invited as admin user"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment