mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-24 08:29:32 +02:00
fix: misc
This commit is contained in:
@@ -24,50 +24,59 @@ import enTime from '../pages/tools/time/i18n/en.json';
|
||||
import hiTime from '../pages/tools/time/i18n/hi.json';
|
||||
import enXml from '../pages/tools/xml/i18n/en.json';
|
||||
import hiXml from '../pages/tools/xml/i18n/hi.json';
|
||||
import Backend from 'i18next-locize-backend';
|
||||
|
||||
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'
|
||||
};
|
||||
// Merge translations for demonstration; in a real app, use namespaces
|
||||
const resources = {
|
||||
en: {
|
||||
translation: {
|
||||
...enGlobal,
|
||||
list: enList,
|
||||
string: enString,
|
||||
csv: enCsv,
|
||||
json: enJson,
|
||||
pdf: enPdf,
|
||||
image: enImage,
|
||||
audio: enAudio,
|
||||
video: enVideo,
|
||||
number: enNumber,
|
||||
time: enTime,
|
||||
xml: enXml
|
||||
}
|
||||
translation: enGlobal,
|
||||
list: enList,
|
||||
string: enString,
|
||||
csv: enCsv,
|
||||
json: enJson,
|
||||
pdf: enPdf,
|
||||
image: enImage,
|
||||
audio: enAudio,
|
||||
video: enVideo,
|
||||
number: enNumber,
|
||||
time: enTime,
|
||||
xml: enXml
|
||||
},
|
||||
hi: {
|
||||
translation: {
|
||||
...hiGlobal,
|
||||
list: hiList,
|
||||
string: hiString,
|
||||
csv: hiCsv,
|
||||
json: hiJson,
|
||||
pdf: hiPdf,
|
||||
image: hiImage,
|
||||
audio: hiAudio,
|
||||
video: hiVideo,
|
||||
number: hiNumber,
|
||||
time: hiTime,
|
||||
xml: hiXml
|
||||
}
|
||||
translation: hiGlobal,
|
||||
list: hiList,
|
||||
string: hiString,
|
||||
csv: hiCsv,
|
||||
json: hiJson,
|
||||
pdf: hiPdf,
|
||||
image: hiImage,
|
||||
audio: hiAudio,
|
||||
video: hiVideo,
|
||||
number: hiNumber,
|
||||
time: hiTime,
|
||||
xml: hiXml
|
||||
}
|
||||
};
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources,
|
||||
lng: 'en',
|
||||
fallbackLng: 'en',
|
||||
interpolation: {
|
||||
escapeValue: false
|
||||
}
|
||||
});
|
||||
i18n
|
||||
.use(Backend)
|
||||
.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
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
Reference in New Issue
Block a user