Working translation
This commit is contained in:
parent
03d66f6d1c
commit
df250eddcb
5 changed files with 34 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
// @ts-check
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {import('next-i18next').UserConfig}
|
||||||
|
*/
|
||||||
module.exports = {
|
module.exports = {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
|
|
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
|
@ -62,7 +62,7 @@ packages:
|
||||||
resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==}
|
resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/types': 7.17.0
|
'@babel/types': 7.21.4
|
||||||
jsesc: 2.5.2
|
jsesc: 2.5.2
|
||||||
source-map: 0.5.7
|
source-map: 0.5.7
|
||||||
dev: true
|
dev: true
|
||||||
|
@ -118,7 +118,7 @@ packages:
|
||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/types': 7.17.0
|
'@babel/types': 7.21.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@babel/runtime@7.21.0:
|
/@babel/runtime@7.21.0:
|
||||||
|
@ -148,7 +148,7 @@ packages:
|
||||||
'@babel/helper-hoist-variables': 7.18.6
|
'@babel/helper-hoist-variables': 7.18.6
|
||||||
'@babel/helper-split-export-declaration': 7.18.6
|
'@babel/helper-split-export-declaration': 7.18.6
|
||||||
'@babel/parser': 7.21.4
|
'@babel/parser': 7.21.4
|
||||||
'@babel/types': 7.17.0
|
'@babel/types': 7.21.4
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
globals: 11.12.0
|
globals: 11.12.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"cna": "Erstelle Next App"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"cna": "Create Next App"
|
||||||
|
}
|
|
@ -1,15 +1,26 @@
|
||||||
import styles from "@/styles/Home.module.css"
|
import styles from "@/styles/Home.module.css"
|
||||||
|
import { GetStaticProps, InferGetStaticPropsType } from "next"
|
||||||
|
import { useTranslation } from "next-i18next"
|
||||||
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
||||||
import { Inter } from "next/font/google"
|
import { Inter } from "next/font/google"
|
||||||
import Head from "next/head"
|
import Head from "next/head"
|
||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] })
|
const inter = Inter({ subsets: ["latin"] })
|
||||||
|
|
||||||
export default function Home() {
|
interface Props {
|
||||||
|
// Add custom props here
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Home(
|
||||||
|
_props: InferGetStaticPropsType<typeof getStaticProps>
|
||||||
|
) {
|
||||||
|
const { t } = useTranslation("common")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Create Next App</title>
|
<title>{t("cna")}</title>
|
||||||
<meta name="description" content="Generated by create next app" />
|
<meta name="description" content="Generated by create next app" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
@ -112,3 +123,10 @@ export default function Home() {
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// or getServerSideProps: GetServerSideProps<Props> = async ({ locale })
|
||||||
|
export const getStaticProps: GetStaticProps<Props> = async ({ locale }) => ({
|
||||||
|
props: {
|
||||||
|
...(await serverSideTranslations(locale ?? "en", ["common", "footer"])),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue