diff --git a/examples/nextjs-swc/next.config.ts b/examples/nextjs-swc/next.config.ts
index 2628cc2e6..30014fac2 100644
--- a/examples/nextjs-swc/next.config.ts
+++ b/examples/nextjs-swc/next.config.ts
@@ -10,8 +10,19 @@ const nextConfig: NextConfig = {
as: '*.js'
}
}
- }
- }
+ },
+ },
+ // turbopack is used for development server only,
+ // so for build we still need webpack configuration
+ webpack: (config) => {
+ config.module.rules.push({
+ test: /\.po$/,
+ use: {
+ loader: '@lingui/loader',
+ },
+ })
+ return config
+ },
}
export default nextConfig
diff --git a/examples/nextjs-swc/src/app/[lang]/app-router-demo/page.tsx b/examples/nextjs-swc/src/app/[lang]/app-router-demo/page.tsx
index 03ee59221..ed677d63a 100644
--- a/examples/nextjs-swc/src/app/[lang]/app-router-demo/page.tsx
+++ b/examples/nextjs-swc/src/app/[lang]/app-router-demo/page.tsx
@@ -1,7 +1,7 @@
import { HomePage } from '../../../components/HomePage'
-import { initLingui } from '../../../initLingui'
+import { initLingui, PageLangParam } from "../../../initLingui"
-export default async function Page(props) {
+export default async function Page(props: PageLangParam) {
const lang = (await props.params).lang
initLingui(lang)
return
diff --git a/examples/nextjs-swc/src/app/[lang]/layout.tsx b/examples/nextjs-swc/src/app/[lang]/layout.tsx
index f9e678582..7110ead87 100644
--- a/examples/nextjs-swc/src/app/[lang]/layout.tsx
+++ b/examples/nextjs-swc/src/app/[lang]/layout.tsx
@@ -2,9 +2,8 @@ import linguiConfig from '../../../lingui.config'
import { allMessages, getI18nInstance } from '../../appRouterI18n'
import { LinguiClientProvider } from '../../components/LinguiClientProvider'
import { initLingui, PageLangParam } from '../../initLingui'
-import React from 'react'
-import { t } from '@lingui/macro'
-import { setI18n } from '@lingui/react/server'
+import React, { PropsWithChildren } from "react"
+import { t } from '@lingui/core/macro'
export async function generateStaticParams() {
return linguiConfig.locales.map((lang) => ({ lang }))
@@ -18,7 +17,7 @@ export async function generateMetadata(props: PageLangParam) {
}
}
-export default async function RootLayout({ children, params }) {
+export default async function RootLayout({ children, params }: PropsWithChildren) {
const lang = (await params).lang
initLingui(lang)
diff --git a/examples/nextjs-swc/src/app/[lang]/page.tsx b/examples/nextjs-swc/src/app/[lang]/page.tsx
index 9498097d8..d3f9972df 100644
--- a/examples/nextjs-swc/src/app/[lang]/page.tsx
+++ b/examples/nextjs-swc/src/app/[lang]/page.tsx
@@ -1,9 +1,11 @@
+import Link from "next/link"
+
export default function Index() {
return (
<>
This is the homepage of the demo app. This page is not localized. You can
- go to the App router demo or the{' '}
- Pages router demo.
+ go to the App router demo or the{' '}
+ Pages router demo.
>
)
}
diff --git a/examples/nextjs-swc/src/components/HomePage.tsx b/examples/nextjs-swc/src/components/HomePage.tsx
index 59a0a3482..1046c1ed0 100644
--- a/examples/nextjs-swc/src/components/HomePage.tsx
+++ b/examples/nextjs-swc/src/components/HomePage.tsx
@@ -1,7 +1,8 @@
import React from 'react'
import { useLingui } from '@lingui/react'
import Head from 'next/head'
-import { t, Trans } from '@lingui/macro'
+import { t } from "@lingui/core/macro"
+import { Trans } from "@lingui/react/macro"
import { Switcher } from './Switcher'
import { AboutText } from './AboutText'
import Developers from './Developers'
diff --git a/examples/nextjs-swc/src/locales/en.po b/examples/nextjs-swc/src/locales/en.po
index 0c5f27f36..2376c0a47 100644
--- a/examples/nextjs-swc/src/locales/en.po
+++ b/examples/nextjs-swc/src/locales/en.po
@@ -38,11 +38,11 @@ msgstr "Serbian"
msgid "Spanish"
msgstr "Spanish"
+#: src/components/HomePage.tsx:22
#: src/app/[lang]/layout.tsx:16
-#: src/components/HomePage.tsx:21
msgid "Translation Demo"
msgstr "Translation Demo"
-#: src/components/HomePage.tsx:28
+#: src/components/HomePage.tsx:29
msgid "Welcome to <0>Next.js!0>"
msgstr "Welcome to <0>Next.js!0>"
diff --git a/examples/nextjs-swc/src/locales/es.po b/examples/nextjs-swc/src/locales/es.po
index 7089e0fdd..8e8a8a24f 100644
--- a/examples/nextjs-swc/src/locales/es.po
+++ b/examples/nextjs-swc/src/locales/es.po
@@ -38,11 +38,11 @@ msgstr "Serbio"
msgid "Spanish"
msgstr "Español"
+#: src/components/HomePage.tsx:22
#: src/app/[lang]/layout.tsx:16
-#: src/components/HomePage.tsx:21
msgid "Translation Demo"
msgstr "Demostración de Traducción"
-#: src/components/HomePage.tsx:28
+#: src/components/HomePage.tsx:29
msgid "Welcome to <0>Next.js!0>"
msgstr "Bienvenido a <0>Next.js!0>"
diff --git a/examples/nextjs-swc/src/locales/pseudo.po b/examples/nextjs-swc/src/locales/pseudo.po
index a907b95ba..22540a6be 100644
--- a/examples/nextjs-swc/src/locales/pseudo.po
+++ b/examples/nextjs-swc/src/locales/pseudo.po
@@ -38,11 +38,11 @@ msgstr ""
msgid "Spanish"
msgstr ""
+#: src/components/HomePage.tsx:22
#: src/app/[lang]/layout.tsx:16
-#: src/components/HomePage.tsx:21
msgid "Translation Demo"
msgstr ""
-#: src/components/HomePage.tsx:28
+#: src/components/HomePage.tsx:29
msgid "Welcome to <0>Next.js!0>"
msgstr ""
diff --git a/examples/nextjs-swc/src/locales/sr.po b/examples/nextjs-swc/src/locales/sr.po
index 9db9c88fc..e438be205 100644
--- a/examples/nextjs-swc/src/locales/sr.po
+++ b/examples/nextjs-swc/src/locales/sr.po
@@ -38,11 +38,11 @@ msgstr "Српски"
msgid "Spanish"
msgstr "Шпански"
+#: src/components/HomePage.tsx:22
#: src/app/[lang]/layout.tsx:16
-#: src/components/HomePage.tsx:21
msgid "Translation Demo"
msgstr "Демо Превод"
-#: src/components/HomePage.tsx:28
+#: src/components/HomePage.tsx:29
msgid "Welcome to <0>Next.js!0>"
msgstr "Добродошли у <0>Нект.јс!0>"
diff --git a/examples/remix-vite-babel/app/modules/lingui/lingui.tsx b/examples/remix-vite-babel/app/modules/lingui/lingui.tsx
index 8efc8adf3..d6de2fe10 100644
--- a/examples/remix-vite-babel/app/modules/lingui/lingui.tsx
+++ b/examples/remix-vite-babel/app/modules/lingui/lingui.tsx
@@ -1,5 +1,5 @@
import { i18n, MessageDescriptor } from "@lingui/core";
-import { msg } from "@lingui/macro";
+import { msg } from "@lingui/core/macro";
import { useFetcher, useFetchers, useMatches, useRouteLoaderData } from "@remix-run/react";
import type config from "./config";
import { ComponentProps } from "react";
diff --git a/examples/remix-vite-babel/app/routes/_index.tsx b/examples/remix-vite-babel/app/routes/_index.tsx
index e554891fc..6e5cd4b0c 100644
--- a/examples/remix-vite-babel/app/routes/_index.tsx
+++ b/examples/remix-vite-babel/app/routes/_index.tsx
@@ -1,4 +1,6 @@
-import { t, Trans } from "@lingui/macro";
+import { t } from "@lingui/core/macro";
+import { Trans } from "@lingui/react/macro";
+
import { json, type MetaFunction } from "@remix-run/node";
import { LocaleSelector } from "~/modules/lingui/lingui";