I have a constant that just export data.
Import i18n from './i18n'
export const offersList = [
{
id: 0,
itemButton: i18n.t('item1'),
title: i18n.t('title1'),
},
{
id: 0,
itemButton: 'Item 1',
title: 'Title 1',
},
{
id: 0,
itemButton: 'Item 1',
title: 'Title 1',
}
];
And when I am trying to use t function inside of key it just return a simple string with key what I want to show. And I have i18n.ts file like this
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
i18n
.use(Backend)
.use(initReactI18next)
.init({
fallbackLng: 'ru',
debug: true,
react: {
useSuspense: false
},
interpolation: {
escapeValue: false,
}
});
export default i18n;