【发布时间】:2020-09-26 06:58:39
【问题描述】:
我正在使用 NextJS 和 next-i18next。这是我的主页:
import {withTranslation} from '../config/next-i18next';
const Home = function Home() {
return (<div>test</div>)
};
Home.getInitialProps = async () => {
return {namespacesRequired: ['home']}
};
export default withTranslation('home')(Home);
我想要的是在组件/页面中获取当前语言,我该怎么做?
【问题讨论】:
标签: node.js reactjs internationalization next.js i18next