Answer the question
In order to leave comments, you need to log in
Returns undefIned when i18next.t() is called?
I get undefined on output. What is the problem? Usage example
import i18next from 'i18next';
export function balancePage() {
console.log(i18next.t('payment_table_label_status')) //undefined
}
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';
const resources = {
en: {
translation: {
payment_table_label_status: 'status'
}
},
ru: {
translation: {
payment_table_label_status: 'статус'
}
}
}
export default i18n
.use(initReactI18next)
.init({
resources,
lng: 'ru',
keySeparator: false,
interpolation: {
escapeValue: false
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question