Features: 1) Add i18n support with multiple locales and default locale in next.config;

Fixes: 1) Add missing import for useRouter in index.tsx;

Extra: n/a;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-07-01 00:47:37 +03:00
parent ba90b98455
commit 4e4c9c4f4f
2 changed files with 25 additions and 1 deletions

View file

@ -1,7 +1,30 @@
import type {NextConfig} from "next";
const nextConfig: NextConfig = {
/* config options here */
i18n: {
locales: [
'en-gb',
'ar-ar',
'cs-cz',
'da-dk',
'de-de',
'en-us',
'es-es',
'fr-fr',
'hi-in',
'it-it',
'ja-jp',
'kk-kz',
'nl-nl',
'pl-pl',
'pt-br',
'ro-ro',
'ru-ru',
'zh-hans'
],
defaultLocale: 'en-gb',
},
};
export default nextConfig;

View file

@ -1,6 +1,7 @@
import {apolloClient} from 'graphql/apolloClient';
import {GET_PRODUCTS} from 'graphql/queries/getProducts';
import {GetStaticProps} from 'next';
import {useRouter} from "next/router";
export const getStaticProps: GetStaticProps = async () => {
const {data} = await apolloClient.query({