commit 2b29a91eb423741c1f0e8a3a7117758f49b1515f
parent 8f298b93198d8c147669050fed5182eaf3c3dd7e
Author: MTRNord <mtrnord1@gmail.com>
Date: Mon, 31 Jan 2022 01:37:11 +0100
Add more strings and set fallback language
Diffstat:
4 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/components/Footer.tsx b/components/Footer.tsx
@@ -1,13 +1,14 @@
import Link from "next/link";
import { PureComponent } from "react";
+import { i18n } from 'next-i18next';
export default class Footer extends PureComponent {
render() {
return (
<footer className="w-full lg:min-h-[25rem] min-h-[12.5rem] bg-[#FEFEFE] dark:bg-[#12161D] flex lg:flex-row flex-col justify-center items-center z-0">
- <Link href={`https://github.com/MTRNord/matrix-art`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">Github</a></Link>
- <Link href={`https://matrix.to/#/#matrix-art:nordgedanken.dev`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">Matrix</a></Link>
- <Link href={`/profile/${encodeURIComponent("@mtrnord:nordgedanken.dev")}`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">Developer</a></Link>
+ <Link href={`https://github.com/MTRNord/matrix-art`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">{i18n?.t('Github')}</a></Link>
+ <Link href={`https://matrix.to/#/#matrix-art:nordgedanken.dev`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">{i18n?.t('Matrix')}</a></Link>
+ <Link href={`/profile/${encodeURIComponent("@mtrnord:nordgedanken.dev")}`} passHref><a className="px-16 text-lg text-gray-700 dark:text-gray-400 font-bold">{i18n?.t('Developer')}</a></Link>
</footer>
);
}
diff --git a/i18next-parser.config.js b/i18next-parser.config.js
@@ -1,5 +1,6 @@
module.exports = {
- locales: ['en', 'de'],
+ locales: ['en'],
defaultNamespace: 'common',
- output: 'public/locales/$LOCALE/$NAMESPACE.json'
+ output: 'public/locales/$LOCALE/$NAMESPACE.json',
+ indentation: 4
}
\ No newline at end of file
diff --git a/next-i18next.config.js b/next-i18next.config.js
@@ -2,5 +2,6 @@ module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'de-DE'],
+ fallbackLng: 'en'
},
};
\ No newline at end of file
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
@@ -1,9 +1,12 @@
{
- "Search & Discover": "Search & Discover",
- "Join": "Join",
- "Log in": "Log in",
- "Profile": "Profile",
- "Logout": "Logout",
- "Submit": "Submit",
- "Setup Account": "Setup Account"
-}
-\ No newline at end of file
+ "Github": "Github",
+ "Matrix": "Matrix",
+ "Developer": "Developer",
+ "Search & Discover": "Search & Discover",
+ "Join": "Join",
+ "Log in": "Log in",
+ "Profile": "Profile",
+ "Logout": "Logout",
+ "Submit": "Submit",
+ "Setup Account": "Setup Account"
+}