Added internationalization

This commit is contained in:
Sebastian Seedorf
2022-08-19 19:06:36 +02:00
parent 8227cc631d
commit 33a5b10fe3
13 changed files with 187 additions and 39 deletions

View File

@@ -9,9 +9,10 @@ import { Preferences } from './Preferences/Preferences'
import { download, streamToArrayBuffer } from '../../src/download'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { I18n } from '../shared/I18n/I18n'
export const Home: FC = () => {
const router = useRouter()
const { query } = useRouter()
const { factories } = useFactories()
const { groups, addGroup, doNotSuggest, ignoredFactories, setIgnoredFactories, store, load } =
useGroups()
@@ -32,7 +33,9 @@ export const Home: FC = () => {
return (
<main>
<h1>Factorio Microservices</h1>
<h1>
<I18n id={'page.home.title'} />
</h1>
<button
onClick={() => {
download('factorio-microservices.bin', store())
@@ -55,7 +58,7 @@ export const Home: FC = () => {
}
}}
/>
<Link href={{ pathname: '/visualize', query: router.query }}>Visualize</Link>
<Link href={{ pathname: '/visualize', query }}>Visualize</Link>
<Preferences />
<fieldset>
<legend>Missing export factories</legend>