2025-07-12 23:02:35 -07:00
|
|
|
import i18n from 'i18next';
|
|
|
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
|
import enGlobal from './en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiGlobal from './hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enList from '../pages/tools/list/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiList from '../pages/tools/list/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enString from '../pages/tools/string/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiString from '../pages/tools/string/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enCsv from '../pages/tools/csv/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiCsv from '../pages/tools/csv/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enJson from '../pages/tools/json/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiJson from '../pages/tools/json/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enPdf from '../pages/tools/pdf/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiPdf from '../pages/tools/pdf/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enImage from '../pages/tools/image/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiImage from '../pages/tools/image/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enAudio from '../pages/tools/audio/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiAudio from '../pages/tools/audio/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enVideo from '../pages/tools/video/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiVideo from '../pages/tools/video/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enNumber from '../pages/tools/number/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiNumber from '../pages/tools/number/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enTime from '../pages/tools/time/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiTime from '../pages/tools/time/i18n/hi.json';
|
2025-07-12 23:02:35 -07:00
|
|
|
import enXml from '../pages/tools/xml/i18n/en.json';
|
2025-07-12 23:15:17 -07:00
|
|
|
import hiXml from '../pages/tools/xml/i18n/hi.json';
|
2025-07-13 11:25:05 +01:00
|
|
|
import Backend from 'i18next-locize-backend';
|
2025-07-12 23:02:35 -07:00
|
|
|
|
2025-07-13 11:25:05 +01:00
|
|
|
const locizeOptions = {
|
|
|
|
|
projectId: 'e7156a3e-66fb-4035-a0f0-cebf1c63a3ba', // Replace with your Locize project ID
|
|
|
|
|
apiKey: import.meta.env.LOCIZE_API_KEY, // Replace with your Locize API key
|
|
|
|
|
referenceLng: 'en',
|
|
|
|
|
version: 'latest'
|
|
|
|
|
};
|
2025-07-12 23:02:35 -07:00
|
|
|
// Merge translations for demonstration; in a real app, use namespaces
|
|
|
|
|
const resources = {
|
|
|
|
|
en: {
|
2025-07-13 11:25:05 +01:00
|
|
|
translation: enGlobal,
|
|
|
|
|
list: enList,
|
|
|
|
|
string: enString,
|
|
|
|
|
csv: enCsv,
|
|
|
|
|
json: enJson,
|
|
|
|
|
pdf: enPdf,
|
|
|
|
|
image: enImage,
|
|
|
|
|
audio: enAudio,
|
|
|
|
|
video: enVideo,
|
|
|
|
|
number: enNumber,
|
|
|
|
|
time: enTime,
|
|
|
|
|
xml: enXml
|
2025-07-12 23:15:17 -07:00
|
|
|
},
|
|
|
|
|
hi: {
|
2025-07-13 11:25:05 +01:00
|
|
|
translation: hiGlobal,
|
|
|
|
|
list: hiList,
|
|
|
|
|
string: hiString,
|
|
|
|
|
csv: hiCsv,
|
|
|
|
|
json: hiJson,
|
|
|
|
|
pdf: hiPdf,
|
|
|
|
|
image: hiImage,
|
|
|
|
|
audio: hiAudio,
|
|
|
|
|
video: hiVideo,
|
|
|
|
|
number: hiNumber,
|
|
|
|
|
time: hiTime,
|
|
|
|
|
xml: hiXml
|
2025-07-12 23:02:35 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-13 11:25:05 +01:00
|
|
|
i18n
|
2025-07-13 13:01:02 +01:00
|
|
|
// .use(Backend)
|
2025-07-13 11:25:05 +01:00
|
|
|
.use(initReactI18next)
|
|
|
|
|
.init({
|
|
|
|
|
resources,
|
|
|
|
|
lng: 'en',
|
|
|
|
|
fallbackLng: 'en',
|
|
|
|
|
interpolation: {
|
|
|
|
|
escapeValue: false
|
|
|
|
|
},
|
|
|
|
|
backend: locizeOptions,
|
|
|
|
|
saveMissing: true, // Send missing keys to Locize
|
|
|
|
|
updateMissing: true // Update keys in Locize
|
|
|
|
|
});
|
2025-07-12 23:02:35 -07:00
|
|
|
|
|
|
|
|
export default i18n;
|