### What problem does this PR solve? - Add complete Italian translation file with all UI sections - Register Italian in LanguageAbbreviation enum and language maps - Configure Italian translation in i18n config - Add Italiano to language selector dropdown ### Type of change - [x] Other (please describe): ## What Added complete Italian language translation support to RAGFlow ## Changes - Added comprehensive Italian translation file ([it.ts](ragflow/web/src/locales/it.ts:0:0-0:0)) with all UI sections (1239 lines) - Registered Italian in `LanguageAbbreviation` enum and all language maps - Configured Italian translation in i18n configuration - Added "Italiano" to language selector dropdown ## Impact - Italian users can now use RAGFlow in their native language - All major UI components are translated including: - Login/registration screens - Knowledge base management - Chat interface - Settings and configuration - Admin console - Error messages and notifications ## Testing - Verified all translation keys are present - Confirmed language selector shows "Italiano" correctly - Tested that no translation keys are missing - All UI sections properly translated Co-authored-by: PentaFrame <info@pentaframe.it>
88 lines
2.6 KiB
TypeScript
88 lines
2.6 KiB
TypeScript
import i18n from 'i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import { LanguageAbbreviation } from '@/constants/common';
|
|
import translation_de from './de';
|
|
import translation_en from './en';
|
|
import translation_es from './es';
|
|
import translation_fr from './fr';
|
|
import translation_id from './id';
|
|
import translation_it from './it';
|
|
import translation_ja from './ja';
|
|
import translation_pt_br from './pt-br';
|
|
import translation_ru from './ru';
|
|
import { createTranslationTable, flattenObject } from './until';
|
|
import translation_vi from './vi';
|
|
import translation_zh from './zh';
|
|
import translation_zh_traditional from './zh-traditional';
|
|
|
|
const resources = {
|
|
[LanguageAbbreviation.En]: translation_en,
|
|
[LanguageAbbreviation.Zh]: translation_zh,
|
|
[LanguageAbbreviation.ZhTraditional]: translation_zh_traditional,
|
|
[LanguageAbbreviation.Id]: translation_id,
|
|
[LanguageAbbreviation.Ja]: translation_ja,
|
|
[LanguageAbbreviation.Es]: translation_es,
|
|
[LanguageAbbreviation.Vi]: translation_vi,
|
|
[LanguageAbbreviation.Ru]: translation_ru,
|
|
[LanguageAbbreviation.PtBr]: translation_pt_br,
|
|
[LanguageAbbreviation.De]: translation_de,
|
|
[LanguageAbbreviation.Fr]: translation_fr,
|
|
[LanguageAbbreviation.It]: translation_it,
|
|
};
|
|
const enFlattened = flattenObject(translation_en);
|
|
const viFlattened = flattenObject(translation_vi);
|
|
const ruFlattened = flattenObject(translation_ru);
|
|
const esFlattened = flattenObject(translation_es);
|
|
const zhFlattened = flattenObject(translation_zh);
|
|
const jaFlattened = flattenObject(translation_ja);
|
|
const pt_brFlattened = flattenObject(translation_pt_br);
|
|
const zh_traditionalFlattened = flattenObject(translation_zh_traditional);
|
|
const deFlattened = flattenObject(translation_de);
|
|
const frFlattened = flattenObject(translation_fr);
|
|
const itFlattened = flattenObject(translation_it);
|
|
export const translationTable = createTranslationTable(
|
|
[
|
|
enFlattened,
|
|
viFlattened,
|
|
ruFlattened,
|
|
esFlattened,
|
|
zhFlattened,
|
|
zh_traditionalFlattened,
|
|
jaFlattened,
|
|
pt_brFlattened,
|
|
deFlattened,
|
|
frFlattened,
|
|
itFlattened,
|
|
],
|
|
[
|
|
'English',
|
|
'Vietnamese',
|
|
'ru',
|
|
'Spanish',
|
|
'zh',
|
|
'zh-TRADITIONAL',
|
|
'ja',
|
|
'pt-BR',
|
|
'Deutsch',
|
|
'French',
|
|
'Italian',
|
|
],
|
|
);
|
|
i18n
|
|
.use(initReactI18next)
|
|
.use(LanguageDetector)
|
|
.init({
|
|
detection: {
|
|
lookupLocalStorage: 'lng',
|
|
},
|
|
supportedLngs: Object.values(LanguageAbbreviation),
|
|
resources,
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
export default i18n;
|