Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add i18n support #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { locales as middleware } from 'nextra/locales';
7 changes: 6 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const withNextra = require('nextra')({
latex: true
})

module.exports = withNextra()
module.exports = withNextra({
i18n: {
locales: ['en', 'de'],
defaultLocale: 'en'
}
})
50 changes: 50 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added pages/_meta.de.json
Empty file.
File renamed without changes.
Empty file.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added pages/faq.de.mdx
Empty file.
File renamed without changes.
13 changes: 13 additions & 0 deletions pages/index.de.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#

import { Analytics } from '@vercel/analytics/react';
import Hero from "../components/hero/hero.tsx";
import Manifest from "../components/manifest/manifest.tsx";
import Landing from "../components/landing/landing.tsx";

# Hallo
# Test
# Prüfung

<Landing />
<Analytics />
File renamed without changes.
4 changes: 4 additions & 0 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const config: DocsThemeConfig = {
text: 'Copyright © 2023. The open-sourced guide on spacetravel.',
},
faviconGlyph: "🌌",
i18n: [
{ locale: 'en', text: 'English' },
{ locale: 'de', text: 'Deutsch' }
],
nextThemes: {
"defaultTheme": "dark"
},
Expand Down