📜  为 React App 添加多语言支持 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:45.410000             🧑  作者: Mango

代码示例1
import { useTranslation } from 'react-i18next';function MyComponent() {  const { t } = useTranslation();// this_is_an_example is the key against translation in locales/en/translation.json file.  return 

{t('this_is_an_example')}

}