0

「オプション」と呼ばれるオブジェクトの配列があり、ドロップダウン/選択マテリアル UI コンポーネントの小道具として使用します。ラベルで next-i18next ライブラリを使用したい。ドキュメントで説明されているように、次のすべてのアプリで既に実装して成功しています。{t('key')} を使用してみましたが、許可されません。

import { useTranslation } from 'next-i18next'
const UsersPage = () => {
   const { t } = useTranslation('user');
   const Options = [
      { value: 'fullName', label: 'Nome' },
      { value: 'cpf', label: 'CPF' },
      { value: 'id', label: 'Padrão' },
   ]
   ...rest of the component
}

export const getStaticProps = async ({ locale }) => ({
  props: {
    ...await serverSideTranslations(locale, ['user', 'home']),
  },
})

export default UsersPage;
4

1 に答える 1