Hello!
For Obsidian Github Publisher, i wanted to update the translation file to using i18next, because some autocompletion will help me a lot during update.
I tryed to do it, but get undefined
everywhere, without error in console.
I created the file i18next.ts
in plugin/i18n
and each translation file is in json
My i18next.ts file :
import i18next from 'i18next';
import {moment} from "obsidian";
import * as en from './locales/en.json';
import * as de from './locales/de.json';
//import fr from "./locales/fr.json";
//detect language
const locale = moment.locale();
export const translationLanguage = locale ? moment.locale() : "en";
console.log("Init i18next")
i18next.init({
lng:locale,
fallbackLng: "en",
resources: {
en: {
translation: en,
},
de: {
translation: de,
}
},
});
I call the i18next like that : i18next.t('somethings')
Maybe Obsidian Plugin can’t use json file ?