restructure translation files

This commit is contained in:
Songyi Huang 2021-05-25 23:21:32 -07:00
parent e396757774
commit c1d5b5cbb7
4 changed files with 22 additions and 19 deletions

View File

@ -21,7 +21,6 @@ function App() {
<Router> <Router>
<Navbar subtitleMap={navbarSubtitleMap} /> <Navbar subtitleMap={navbarSubtitleMap} />
<div style={{ marginTop: '75px' }}> <div style={{ marginTop: '75px' }}>
{t('wdnmd')}
<Route exact path="/"> <Route exact path="/">
<Redirect to="/leaderboard?type=game&name=leduc-holdem" /> <Redirect to="/leaderboard?type=game&name=leduc-holdem" />
{/* <Redirect to="/pve/doudizhu-demo" /> */} {/* <Redirect to="/pve/doudizhu-demo" /> */}

View File

@ -1,31 +1,17 @@
import i18n from 'i18next'; import i18n from 'i18next';
import { initReactI18next } from 'react-i18next'; import { initReactI18next } from 'react-i18next';
import translationEN from './locales/en/translation.json';
import translationZH from './locales/zh/translation.json';
// the translations // the translations
// (tip move them in a JSON file and import them, // (tip move them in a JSON file and import them,
// or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui) // or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)
const resources = { const resources = {
en: { en: {
translation: { translation: translationEN,
doudizhu: {
ai_hand_faceup: 'AI Hand Face-Up',
play_as_landlord: 'Play As Landlord',
play_as_peasant: 'Play As Peasant',
landlord_up: 'Landlord Up',
landlord_down: 'Landlord Down',
},
},
}, },
zh: { zh: {
translation: { translation: translationZH,
doudizhu: {
ai_hand_faceup: '显示AI手牌',
play_as_landlord: '扮演地主',
play_as_peasant: '扮演农民',
landlord_up: '地主上家',
landlord_down: '地主下家',
},
},
}, },
}; };

View File

@ -0,0 +1,9 @@
{
"doudizhu": {
"ai_hand_faceup": "AI Hand Face-Up",
"play_as_landlord": "Play As Landlord",
"play_as_peasant": "Play As Peasant",
"landlord_up": "Landlord Up",
"landlord_down": "Landlord Down"
}
}

View File

@ -0,0 +1,9 @@
{
"doudizhu": {
"ai_hand_faceup": "显示AI手牌",
"play_as_landlord": "扮演地主",
"play_as_peasant": "扮演农民",
"landlord_up": "地主上家",
"landlord_down": "地主下家"
}
}