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 = {
|
||||
i18n: {
|
||||
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==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
'@babel/types': 7.17.0
|
||||
'@babel/types': 7.21.4
|
||||
jsesc: 2.5.2
|
||||
source-map: 0.5.7
|
||||
dev: true
|
||||
|
@ -118,7 +118,7 @@ packages:
|
|||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@babel/types': 7.17.0
|
||||
'@babel/types': 7.21.4
|
||||
dev: true
|
||||
|
||||
/@babel/runtime@7.21.0:
|
||||
|
@ -148,7 +148,7 @@ packages:
|
|||
'@babel/helper-hoist-variables': 7.18.6
|
||||
'@babel/helper-split-export-declaration': 7.18.6
|
||||
'@babel/parser': 7.21.4
|
||||
'@babel/types': 7.17.0
|
||||
'@babel/types': 7.21.4
|
||||
debug: 4.3.4
|
||||
globals: 11.12.0
|
||||
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 { GetStaticProps, InferGetStaticPropsType } from "next"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
||||
import { Inter } from "next/font/google"
|
||||
import Head from "next/head"
|
||||
import Image from "next/image"
|
||||
|
||||
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 (
|
||||
<>
|
||||
<Head>
|
||||
<title>Create Next App</title>
|
||||
<title>{t("cna")}</title>
|
||||
<meta name="description" content="Generated by create next app" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<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