Implementation:Infiniflow Ragflow Localization System
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Internationalization |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete internationalization translation dictionary system supporting 12 languages for the RAGFlow frontend application.
Description
The RAGFlow localization system consists of per-language TypeScript modules that export translation key-value dictionaries. The system supports: English (en), German (de), Spanish (es), French (fr), Indonesian (id), Italian (it), Japanese (ja), Portuguese-Brazilian (pt-br), Russian (ru), Vietnamese (vi), Traditional Chinese (zh-traditional), and Simplified Chinese (zh). Each module exports a flat or nested object structure with translation strings organized by feature area (common, chat, knowledgeBase, fileManager, etc.).
Usage
These locale files are consumed by the i18next framework configured in locales/config.ts. Individual translation strings are accessed via the useTranslation hook throughout the frontend.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/locales/en.ts (primary)
- Lines: 1-2603 (en.ts, largest locale)
Signature
// Each locale file exports a default translation object:
export default {
common: { ... },
chat: { ... },
knowledgeBase: { ... },
fileManager: { ... },
// ... feature-specific sections
} as const;
Import
import en from '@/locales/en';
import zh from '@/locales/zh';
// Or via i18next:
import { useTranslation } from 'react-i18next';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Static export modules, no runtime inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| default export | object | Nested translation dictionary |
Usage Examples
import { useTranslation } from 'react-i18next';
function MyComponent() {
const { t } = useTranslation();
return <h1>{t('common.save')}</h1>;
}