Skip to content

Commit

Permalink
chore: add some missing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
eMerzh committed Feb 11, 2024
1 parent 3285240 commit 5f66172
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 41 deletions.
7 changes: 4 additions & 3 deletions src/components/deck/SubDeckSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IconPlus } from "@tabler/icons-react";
import DeckTable from "./DeckTable";
import { Deck, useSubDecks } from "../../logic/deck";
import NewDeckModal from "./NewDeckModal";
import { useTranslation } from "react-i18next";

interface SubDeckSectionProps {
deck?: Deck;
Expand All @@ -13,7 +14,7 @@ interface SubDeckSectionProps {
function SubDeckSection({ deck }: SubDeckSectionProps) {
const [subDecks, areSubDecksReady] = useSubDecks(deck);
const [newDeckModalOpened, setNewDeckModalOpened] = useState(false);

const [t] = useTranslation();
function NewSubDeckButton() {
return (
<Button
Expand All @@ -26,7 +27,7 @@ function SubDeckSection({ deck }: SubDeckSectionProps) {
}
}}
>
New Sub Deck
{t("deck.subdeck.new")}
</Button>
);
}
Expand All @@ -41,7 +42,7 @@ function SubDeckSection({ deck }: SubDeckSectionProps) {
(subDecks ? (
<DeckTable deckList={subDecks} isReady={true} />
) : (
<Text c="dimmed">Failed to load sub decks.</Text>
<Text c="dimmed">{t("deck.subdeck.load-fail")}</Text>
))}
</Section>
<NewDeckModal
Expand Down
6 changes: 4 additions & 2 deletions src/components/notebook/NotebookView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ import { Button, Stack } from "@mantine/core";
import Section from "../settings/Section";
import { IconPlus } from "@tabler/icons-react";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";

export default function NotebookView() {
const navigate = useNavigate();
const [t] = useTranslation();
const [deck] = useDeckFromUrl();

const [cards] = useCardsOf(deck);

return (
<Section
title="Notebook View"
title={t("deck.notebook.title")}
rightSection={
<Button
leftSection={<IconPlus />}
variant="default"
onClick={() => navigate("/new/" + deck?.id)}
>
Add Cards
{t("deck.add-cards")}
</Button>
}
>
Expand Down
3 changes: 1 addition & 2 deletions src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ export default function SettingsView() {
<AboutSettingsView />
</Tabs.Panel>
<Tabs.Panel value="Developer">
This is the developer tab. It will contain extra settings for
developers.
{t("settings.developer.description")}
</Tabs.Panel>
</Tabs>
</Stack>
Expand Down
45 changes: 29 additions & 16 deletions src/i18n/locales/de/translation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"deck": {
"settings": "",
"review-cards-label_one": "1 Wiederholen",
"review-cards-label_other": "{{count}} Wiederholen",
"new-cards-label_one": "1 Neu",
Expand All @@ -9,11 +10,30 @@
"new-cards-label": "Neu",
"learning-cards-label": "Lernen",
"review-cards-label": "Wiederholen",
"new-deck-button": "Neuer Stapel"
"subdeck": {
"new": "",
"load-fail": ""
},
"new-deck-button": "Neuer Stapel",
"notebook": {
"title": ""
},
"add-cards": ""
},
"home": {
"welcome-user": "Willkommen zurück, {{name}}!",
"welcome": "Willkomen!"
"welcome": "Willkomen!",
"title": ""
},
"learning": {
"finished-congrats-name": "Herzlichen Glückwunsch, {{name}}!",
"finished-congrats": "Herzlichen Glückwunsch!",
"finished-info": "Du hast alle Karten in diesem Stapel für heute gelernt!",
"finished-duration": "Dauer",
"finished-accuracy-ratio": "Genauigkeit",
"finished-repetions-count": "Wiederholt",
"finished-button-home": "Zum Start",
"finished-button-to-deck": "Zurück zum Stapel"
},
"settings": {
"about": {
Expand All @@ -29,31 +49,24 @@
"language-description": "Ändere die Sprache der Benutzeroberfläche.",
"title": "Allgemein"
},
"learn": {
"requestRetention": "",
"maximumInterval": "",
"title": "Lernen"
},
"page-title": "",
"appearance": {
"title": "Erscheinungsbild"
},
"editing": {
"title": "Bearbeitung"
},
"learn": {
"title": "Lernen"
},
"database": {
"title": "Datenbank"
},
"developer": {
"title": "Entwickler"
"title": "Entwickler",
"description": ""
}
},
"learning": {
"finished-congrats": "Herzlichen Glückwunsch!",
"finished-congrats-name": "Herzlichen Glückwunsch, {{name}}!",
"finished-button-home": "Zum Start",
"finished-button-to-deck": "Zurück zum Stapel",
"finished-repetions-count": "Wiederholt",
"finished-accuracy-ratio": "Genauigkeit",
"finished-duration": "Dauer",
"finished-info": "Du hast alle Karten in diesem Stapel für heute gelernt!"
}
}
41 changes: 26 additions & 15 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"deck": {
"settings": "Settings",
"review-cards-label_one": "1 Review",
"review-cards-label_other": "{{ count }} Review",
"new-cards-label_one": "1 New",
Expand All @@ -9,14 +10,31 @@
"new-cards-label": "New",
"learning-cards-label": "Learning",
"review-cards-label": "Review",
"subdeck": {
"new": "New Subdeck",
"load-fail": "Failed to load sub decks."
},
"new-deck-button": "New Deck",
"settings": "Settings"
"notebook": {
"title": "Notebook View"
},
"add-cards": "Add Cards"
},
"home": {
"welcome-user": "Welcome back, {{name}}!",
"welcome": "Welcome!",
"title": "Home"
},
"learning": {
"finished-congrats-name": "Congratulations, {{name}}!",
"finished-congrats": "Congratulations!",
"finished-info": "You learned all cards for today in this deck.",
"finished-duration": "Duration",
"finished-accuracy-ratio": "Accuracy",
"finished-repetions-count": "Repetitions",
"finished-button-home": "Go Home",
"finished-button-to-deck": "Back to the deck"
},
"settings": {
"about": {
"description": "This program was made by a student from Germany studying medicine. Skola is in early development. You may encounter bugs. If you do, I'd be very pleased if you reported them on the git repository.",
Expand All @@ -31,6 +49,11 @@
"language-description": "Set the language for the user interface.",
"title": "General"
},
"learn": {
"requestRetention": "Request retention",
"maximumInterval": "Maxium interval",
"title": "Learning"
},
"page-title": "Settings",
"appearance": {
"title": "Appearance"
Expand All @@ -42,20 +65,8 @@
"title": "Database"
},
"developer": {
"title": "Developer"
},
"learn": {
"title": "Learning"
"title": "Developer",
"description": "This is the developer tab. It will contain extra settings for developers."
}
},
"learning": {
"finished-congrats": "Congratulations!",
"finished-congrats-name": "Congratulations, {{name}}!",
"finished-button-home": "Go Home",
"finished-button-to-deck": "Back to the deck",
"finished-repetions-count": "Repetitions",
"finished-accuracy-ratio": "Accuracy",
"finished-duration": "Duration",
"finished-info": "You learned all cards for today in this deck."
}
}
32 changes: 29 additions & 3 deletions src/i18n/locales/sv/translation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"deck": {
"settings": "",
"review-cards-label_one": "",
"review-cards-label_other": "",
"new-cards-label_one": "",
Expand All @@ -9,11 +10,30 @@
"new-cards-label": "Nya",
"learning-cards-label": "Plugga",
"review-cards-label": "Repetera",
"new-deck-button": ""
"subdeck": {
"new": "",
"load-fail": ""
},
"new-deck-button": "",
"notebook": {
"title": ""
},
"add-cards": ""
},
"home": {
"welcome-user": "Welcome back, {{name}}!",
"welcome": "Welcome!"
"welcome": "Welcome!",
"title": ""
},
"learning": {
"finished-congrats-name": "",
"finished-congrats": "",
"finished-info": "",
"finished-duration": "",
"finished-accuracy-ratio": "",
"finished-repetions-count": "",
"finished-button-home": "",
"finished-button-to-deck": ""
},
"settings": {
"about": {
Expand All @@ -29,6 +49,11 @@
"language-description": "Språk som används i gränssnittet.",
"title": "General"
},
"learn": {
"requestRetention": "",
"maximumInterval": "",
"title": ""
},
"page-title": "",
"appearance": {
"title": "Utseende"
Expand All @@ -40,7 +65,8 @@
"title": "Databas"
},
"developer": {
"title": "Utvecklare"
"title": "Utvecklare",
"description": ""
}
}
}

0 comments on commit 5f66172

Please sign in to comment.