+ {i18next.i18n.locales.map((locale_) => {
return (
-
+
{localeNames[locale_]}
)
diff --git a/examples/with-next-i18next/renderer/lib/get-static.js b/examples/with-next-i18next/renderer/lib/get-static.js
index e918cf1a..d5d9b70e 100644
--- a/examples/with-next-i18next/renderer/lib/get-static.js
+++ b/examples/with-next-i18next/renderer/lib/get-static.js
@@ -1,9 +1,9 @@
-import {serverSideTranslations} from "next-i18next/serverSideTranslations"
+import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
-import i18next from "../../next-i18next.config.js"
+import i18next from '../../next-i18next.config.js'
export function getI18nPaths() {
- return ["en", "de"].map(locale => ({
+ return ['en', 'de'].map((locale) => ({
params: {
locale,
},
@@ -12,12 +12,13 @@ export function getI18nPaths() {
export function getStaticPaths() {
return {
- fallback: false, paths: getI18nPaths(),
+ fallback: false,
+ paths: getI18nPaths(),
}
}
-export async function getI18nProperties(context, namespaces = ["common"]) {
- const locale = context?.params?.locale ?? i18next.i18n.defaultLocale;
+export async function getI18nProperties(context, namespaces = ['common']) {
+ const locale = context?.params?.locale ?? i18next.i18n.defaultLocale
return {
...(await serverSideTranslations(locale, namespaces)),
}
@@ -27,6 +28,6 @@ export function makeStaticProperties(namespaces = []) {
return async function (context) {
return {
props: await getI18nProperties(context, namespaces),
- };
- };
+ }
+ }
}
diff --git a/examples/with-next-i18next/renderer/next.config.js b/examples/with-next-i18next/renderer/next.config.js
index df0fb64b..bc7f0401 100644
--- a/examples/with-next-i18next/renderer/next.config.js
+++ b/examples/with-next-i18next/renderer/next.config.js
@@ -3,5 +3,5 @@ module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
- }
+ },
}
diff --git a/examples/with-next-i18next/renderer/pages/[locale]/home.jsx b/examples/with-next-i18next/renderer/pages/[locale]/home.jsx
index 7353e4f9..f8f331d5 100644
--- a/examples/with-next-i18next/renderer/pages/[locale]/home.jsx
+++ b/examples/with-next-i18next/renderer/pages/[locale]/home.jsx
@@ -1,14 +1,18 @@
import React from 'react'
import Head from 'next/head'
import Link from 'next/link'
-import { useTranslation } from "next-i18next"
+import Image from 'next/image'
+import { useTranslation } from 'next-i18next'
-import LanguageSwitcher from "../../components/LanguageSwitcher"
-import { getStaticPaths, makeStaticProperties } from "../../lib/get-static";
+import LanguageSwitcher from '../../components/LanguageSwitcher'
+import { getStaticPaths, makeStaticProperties } from '../../lib/get-static'
export default function HomePage() {
- const {i18n: {language: locale}, t} = useTranslation()
- const [message, setMessage] = React.useState(t("noMessageFound"))
+ const {
+ i18n: { language: locale },
+ t,
+ } = useTranslation()
+ const [message, setMessage] = React.useState(t('noMessageFound'))
React.useEffect(() => {
window.ipc.on('message', (message) => {
@@ -20,20 +24,18 @@ export default function HomePage() {
return (
- {`${t("common:home")} - Nextron (with nexti18next)`}
+ {`${t('common:home')} - Nextron (with-next-i18next)`}
@@ -42,15 +44,15 @@ export default function HomePage() {
window.ipc.send('message', 'Hello')
}}
>
- {t("common:testIPC")}
+ {t('common:testIPC')}
{message}
-
+
)
}
-export const getStaticProps = makeStaticProperties(["common"]);
+export const getStaticProps = makeStaticProperties(['common'])
-export {getStaticPaths};
+export { getStaticPaths }
diff --git a/examples/with-next-i18next/renderer/pages/[locale]/next.jsx b/examples/with-next-i18next/renderer/pages/[locale]/next.jsx
index 7bb1c54d..036d9b4a 100644
--- a/examples/with-next-i18next/renderer/pages/[locale]/next.jsx
+++ b/examples/with-next-i18next/renderer/pages/[locale]/next.jsx
@@ -1,32 +1,33 @@
import React from 'react'
import Head from 'next/head'
import Link from 'next/link'
-import { useTranslation } from "next-i18next"
+import { useTranslation } from 'next-i18next'
-import LanguageSwitcher from "../../components/LanguageSwitcher"
-import { getStaticPaths, makeStaticProperties } from "../../lib/get-static"
+import LanguageSwitcher from '../../components/LanguageSwitcher'
+import { getStaticPaths, makeStaticProperties } from '../../lib/get-static'
export default function NextPage() {
- const {i18n: {language: locale}, t} = useTranslation()
+ const {
+ i18n: { language: locale },
+ t,
+ } = useTranslation()
return (
- {`${t("next")} - Nextron (with nexti18next)`}
+ {`${t('next')} - Nextron (with-next-i18next)`}
-
-
- ⚡ Electron + Next.js ⚡ -
-
- {t("goToHome")}
-
+
+
+ ⚡ Electron + Next.js ⚡ -
+ {t('goToHome')}
-
+
)
}
-export const getStaticProps = makeStaticProperties(["common"]);
+export const getStaticProps = makeStaticProperties(['common'])
-export { getStaticPaths };
\ No newline at end of file
+export { getStaticPaths }
diff --git a/examples/with-next-i18next/renderer/pages/_app.jsx b/examples/with-next-i18next/renderer/pages/_app.jsx
index 90a45f19..ad8b29fc 100644
--- a/examples/with-next-i18next/renderer/pages/_app.jsx
+++ b/examples/with-next-i18next/renderer/pages/_app.jsx
@@ -1,8 +1,6 @@
-import {appWithTranslation} from "next-i18next"
-
-
-function App({Component, pageProps}) {
+import { appWithTranslation } from 'next-i18next'
+function App({ Component, pageProps }) {
return (
<>
diff --git a/examples/with-next-i18next/renderer/pages/_document.jsx b/examples/with-next-i18next/renderer/pages/_document.jsx
index f3bbcc37..6c6e6ea4 100644
--- a/examples/with-next-i18next/renderer/pages/_document.jsx
+++ b/examples/with-next-i18next/renderer/pages/_document.jsx
@@ -1,14 +1,16 @@
-import Document, { Head, Html, Main, NextScript } from "next/document"
-import i18next from "../../next-i18next.config.js"
+import Document, { Head, Html, Main, NextScript } from 'next/document'
+import i18next from '../../next-i18next.config.js'
export default class MyDocument extends Document {
render() {
- return (
-
+ return (
+
+
-
-
+
+
- );
+
+ )
}
}
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 41fdc54c..aaf90d17 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -20,8 +20,8 @@
"autoprefixer": "^10.4.16",
"electron": "^28.2.1",
"electron-builder": "^24.9.1",
- "next": "^12.3.4",
- "nextron": "^8.13.0",
+ "next": "^13.5.6",
+ "nextron": "^8.14.0",
"postcss": "^8.4.30",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/examples/with-tailwindcss/renderer/pages/home.tsx b/examples/with-tailwindcss/renderer/pages/home.tsx
index ed5c5bd5..4834554e 100644
--- a/examples/with-tailwindcss/renderer/pages/home.tsx
+++ b/examples/with-tailwindcss/renderer/pages/home.tsx
@@ -15,8 +15,8 @@ export default function HomePage() {
className="ml-auto mr-auto"
src="/images/logo.png"
alt="Logo image"
- width="256px"
- height="256px"
+ width={256}
+ height={256}
/>