【发布时间】:2022-01-04 13:49:36
【问题描述】:
我在下一个应用中使用 i18n,我需要在 getStaticProps 中访问当前页面语言,然后获取数据
export const getStaticProps = async () => {
//need to get language here
return {
props: { data },
};
};
const App = ({ data }) => {
//my component where i can get language
const { t, i18n } = useTranslation();
const currentLang = i18n.language;
};
【问题讨论】: