diff --git a/locales/en.json b/locales/en.json
new file mode 100644
index 0000000..1658508
--- /dev/null
+++ b/locales/en.json
@@ -0,0 +1,12 @@
+{
+ "common": {
+ "welcome": "Welcome to Vänner Bäst.",
+ "desc": "A Young Royals fan website with links to different discussion spaces.",
+ "watch": {
+ "title": "Watch",
+ "desc": "Watch the series on Netflix"
+ },
+ "discord": "Join our community Discord server to discuss all things Young Royals",
+ "reddit": "Join the community subreddit to discuss Young Royals"
+ }
+}
\ No newline at end of file
diff --git a/locales/es.json b/locales/es.json
new file mode 100644
index 0000000..fc6455d
--- /dev/null
+++ b/locales/es.json
@@ -0,0 +1,12 @@
+{
+ "common": {
+ "welcome": "Bienvid@ a Vänner Bäst.",
+ "desc": "Un sitio web de fans de Young Royals con enlaces a diferentes espacios de discusión.",
+ "watch": {
+ "title": "Ver",
+ "desc": "Ver la serie en Netflix"
+ },
+ "discord": "Únase a nuestro servidor de Discord de la comunidad para discutir sobre Young Royals",
+ "reddit": "Únase al subreddit de la comunidad para discutir sobre Young Royals"
+ }
+}
\ No newline at end of file
diff --git a/next-i18next.config.js b/next-i18next.config.js
new file mode 100644
index 0000000..b79fa82
--- /dev/null
+++ b/next-i18next.config.js
@@ -0,0 +1,6 @@
+module.exports = {
+ i18n: {
+ defaultLocale: 'en',
+ locales: ['en', 'es'],
+ },
+};
\ No newline at end of file
diff --git a/next.config.js b/next.config.js
index c824bb9..e8358be 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,5 +1,7 @@
+const { i18n } = require('./next-i18next.config');
module.exports = {
+ i18n,
reactStrictMode: true,
async redirects() {
return [
@@ -7,6 +9,16 @@ module.exports = {
source: '/discord',
destination: 'https://discord.gg/ugxv4ZrVjC',
permanent: true
+ },
+ {
+ source: '/reddit',
+ destination: 'https://www.reddit.com/r/YoungRoyals/',
+ permanent: true
+ },
+ {
+ source: '/watch',
+ destination: 'https://www.netflix.com/gb/title/81210762?s=i&trkid=13747225&vlang=en&clip=81459758',
+ permanent: true
}
]
}
diff --git a/package.json b/package.json
index 147acf0..02baa07 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
},
"dependencies": {
"next": "11.0.1",
+ "next-intl": "^1.4.4",
"react": "17.0.2",
"react-dom": "17.0.2"
},
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 945e892..9e9e2ff 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,7 +1,10 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'
+import {NextIntlProvider} from 'next-intl';
-function MyApp({ Component, pageProps }: AppProps) {
- return
+function _App({ Component, pageProps }: AppProps) {
+ return
+
+
}
-export default MyApp
+export default _App
diff --git a/pages/index.tsx b/pages/index.tsx
index 21c89c9..f3b3fa4 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1,24 +1,55 @@
import Head from 'next/head'
-import Image from 'next/image'
+import Link from 'next/link'
import styles from '../styles/Home.module.css'
+import { useRouter } from 'next/router'
+import { useTranslations } from 'next-intl'
+import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
+
+export function getStaticProps({locale}: GetStaticPropsContext) {
+ return {
+ props: {
+ // You can get the messages from anywhere you like, but the recommended
+ // pattern is to put them in JSON files separated by language and read
+ // the desired one based on the `locale` received from Next.js.
+ messages: require(`../locales/${locale}.json`),
+ }
+ };
+}
export default function Home() {
+ const router = useRouter()
+ const t = useTranslations('common')
return (
- Vanner Bast | Friends Best
+ Vänner Bäst | Friends Best