Skip to content

EuphoriaCHN/English_Dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My English Dictionary

Euphoria Blog

Clone

git clone https://github.com/EuphoriaCHN/English_Dict.git
cd ./English_Dict

Install Dependencies

npm config set registry https://registry.npm.taobao.org/
npm install -g yarn
yarn deps

Development

yarn dev

i18n

yarn i18n

Add new source language to project

Edit /scripts/i18n/index.js to add new language:

// Line 9
const LANGS = ['zh-CN', 'en-US', /* New language */];

Edit /client/src/components/LanguageSelector/index.tsx to ensure ensure the normal display of the frontend.

// Line 19
const languages: { [k: string]: string } = React.useMemo(() => ({
    'zh-cn': '简体中文',
    'en-us': 'English',
    /* New language */
}), []);

Finally, run i18n scripts again to generate i18n static locale:

yarn i18n

About MomentJS

Frontend project used MomentJS Webpack Plugin for optimizing. More details see /client/.umirc.ts chainWebpack configurations:

chainWebpack(chain) {
  chain.plugin('moment-js-webpack-plugin').use(new MomentLocalesPlugin({
      localesToKeep: ['en', 'zh-cn']
  }));
}

Deployment

Stay tuned...

About

自用小词典

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published