support i18n

This commit is contained in:
john 2022-05-10 17:55:03 +07:00
parent 0603bbb064
commit e2ceff4a4d
6 changed files with 61 additions and 1 deletions

View File

@ -13,7 +13,7 @@ const menuItems = [
]
const docItems = [
{ name: 'Anouncement', icon: '', path: '' },
{ name: 'Announcement', icon: '', path: '' },
{ name: 'FAQ', icon: '', path: '' },
{ name: 'Tutorial', icon: '', path: '' },
]

59
src/i18.js Normal file
View File

@ -0,0 +1,59 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
const resources = {
en: {
translation: {
home: 'Home',
farm: 'farm',
announcement: 'Announcement',
faq: 'FAQ',
tutorial: 'tutorial',
connectWallet: 'Connect Wallet',
tvl: 'TVL',
totalUsersEarned: 'Total Users Earned',
personalTvl: 'Personal TVL',
totalPersonalEarned: 'Total Personal Earned',
harvest: 'Harvest',
apy: 'APY',
compoundInterest: 'Compound Interest',
deposite: 'Deposite',
vl: 'VL',
remaining: 'Remaining',
withdrawal: 'Withdrawal',
mining: 'Mining',
defiFarm: 'Defi Farm',
multiChainLockupValue: 'Multi-chain Lock-up Value',
multiChainUserRevenue: 'Multi-chain User Revenue',
miningOutput: 'Mining Output',
miningOutputValue: 'Mining Output Value',
multiChainReward: 'Multi-chain Reward',
multiChainBurned: 'Multi-chain Burned',
more: 'More',
partners: 'Partners',
auditors: 'Auditors',
}
},
fr: {
translation: {
}
},
tw: {
translation: {
}
},
}
i18n.use(initReactI18next).init({
resources,
lng: 'en', // language to use.
fallbackLng: 'en',
debug: process.env.NODE_ENV === 'development',
interpolation: {
escapeValue: false
}
})
export default i18n;

View File

@ -1,6 +1,7 @@
import { ColorModeScript } from '@chakra-ui/react';
import React, { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import i18n from './i18'
import App from './App';
import { Home, Farm } from './pages'
import reportWebVitals from './reportWebVitals';

0
src/lang/en.js Normal file
View File

0
src/lang/fr.js Normal file
View File

0
src/lang/tw.js Normal file
View File