RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
import { useContext } from 'react';
import { en } from '../i18n/locales/en';
import { TranslationContext } from '../i18n/translation-context';
export function useTranslation() {
const translation = useContext(TranslationContext);
return translation ?? en;
}
export function formatTranslation(
template: string,
values: Record<string, string | number>,
) {
return template.replace(/\{(\w+)\}/g, (_, key) => {
const value = values[key];
return value !== undefined ? String(value) : `{${key}}`;
});
}