Skip to content

Commit

Permalink
#129: working en/es, need to translate the remaining components/pages
Browse files Browse the repository at this point in the history
  • Loading branch information
brklyn8900 committed Nov 21, 2024
1 parent 2135f1c commit c13937b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
12 changes: 0 additions & 12 deletions middleware.js

This file was deleted.

8 changes: 4 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const withNextIntl = createNextIntlPlugin('./i18n/request.js');

/** @type {import('next').NextConfig} */
const nextConfig = {
// i18n: {
// locales: ['en', 'es'],
// defaultLocale: 'en',
// },
i18n: {
locales: ['en', 'es'],
defaultLocale: 'en',
},
reactStrictMode: false,
output: 'standalone',
async headers() {
Expand Down
5 changes: 3 additions & 2 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ import "/public/css/responsive.css"

function MyApp({ Component, pageProps }) {
const router = useRouter();
const messages = pageProps.messages || {};

useEffect(() => {
initGTM();
}, []);

return (
<NextIntlClientProvider
locale={router.locale}
messages={pageProps.messages}
locale={router.locale || 'en'}
messages={messages}
timeZone="UTC"
>
<Component {...pageProps} />
Expand Down
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function IndexPage() {
);
}

export async function getStaticProps({ params: { locale } }) {
export async function getStaticProps({ locale }) {
return {
props: {
messages: (await import(`../messages/${locale}.json`)).default
Expand Down

0 comments on commit c13937b

Please sign in to comment.