Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/app/common/language/language.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const Locales = ["EN", "RU"] as const
export const Locales = ["EN", "RU", "DE"] as const

// make union type from array of locales
export type Locale = typeof Locales[number]
234 changes: 234 additions & 0 deletions src/app/common/language/translations/de/de.countries.ts

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions src/app/common/language/translations/de/de.game-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { CountryCode } from "src/app/interfaces/iso-3166.interface"
import { CountryTranslation, TranslationCountries } from "./de.countries"

export class TranslationGamePage {
protected translationCountries = new TranslationCountries()

guessCountryTitle = "Zu welchem Land gehört diese Flagge?""

finishModal = {
title: "Spiel beenden?",
totalAnswers: "Antworten Gesamt",
correctAnswers: "Richtige Antworten",
wrongAnswers: "Falsche Antworten",
timePassed: "Vergangene Zeit",
buttons: {
finish: "Beenden",
},
}

getGuessCapitalTitle({ countryCode }: { countryCode: CountryCode }): string {
const countryName = this.getCountryNameTranslation(countryCode)

return `Was ist die Hauptstadt von ${countryName} ?`
}

getGuessPopulationTitle({ countryCode }: { countryCode: CountryCode }): string {
const countryName = this.getCountryNameTranslation(countryCode)

return `Wie viele Einwohner hat ${countryName}?`
}

protected getCountryNameTranslation(countryCode: CountryCode) {
const { name: countryName } = this.getCountryTranslation(countryCode)

return countryName
}

protected getCountryTranslation(countryCode: CountryCode): CountryTranslation {
return this.translationCountries[countryCode]
}
}
9 changes: 9 additions & 0 deletions src/app/common/language/translations/de/de.games-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class TranslationGamesPage {
title = "Spiele"

games = {
guessCountry: "Land erraten",
guessCapital: "Hauptstadt erraten",
guessPopulation: "Einwohnerzahl erraten".
}
}
43 changes: 43 additions & 0 deletions src/app/common/language/translations/de/de.settings-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export class TranslationSettingsPage {
title = "Einstellungen"

difficulty = {
title: "Schwierigkeit",
easy: "Einfach",
medium: "Mittel",
hard: "Schwer",
}

gameLength = {
title: "Spiellänge",
short: "Kurz",
medium: "Mittel",
long: "Lang",
}

background = {
title: "Hintergrund",
light: "Hell",
nord: "Nord",
github: "GitHub",
retro: "Retro",
dark: "Dunkel",
black: "Schwarz",
}

accent = {
title: "Akzent",
}

readonly language = {
title: "Sprache",
english: "Englisch",
russian: "Russisch",
german: "Deutsch"
}

categories = {
general: "Generell",
theme: "Thema",
}
}
7 changes: 7 additions & 0 deletions src/app/common/language/translations/de/de.statistics-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class TranslationStatisticsPage {
title = "Statistiken"

history = "Geschichte"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verlauf would be more fitting


historyIsEmpty = "Keine Geschichte"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kein Verlauf or something like a bit longer that would potentially change the meaning.

}
7 changes: 7 additions & 0 deletions src/app/common/language/translations/de/de.statistics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class TranslationStatistics {
correctAnswers = "Richtige Antworten"

date = "Datum"

timeTaken = "Benötigte Zeit"
}
26 changes: 26 additions & 0 deletions src/app/common/language/translations/de/de.translation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Locale } from "../../language.interface"
import { TranslationCountries } from "./de.countries"
import { TranslationGamePage } from "./de.game-page"
import { TranslationGamesPage } from "./de.games-page"
import { TranslationSettingsPage } from "./de.settings-page"
import { TranslationStatistics } from "./de.statistics"
import { TranslationStatisticsPage } from "./de.statistics-page"
import { TranslationUI } from "./de.ui"

export class Translation {
readonly localeKey: Locale = "DE"

readonly ui = new TranslationUI()

readonly settingsPage = new TranslationSettingsPage()

readonly gamesPage = new TranslationGamesPage()

readonly gamePage = new TranslationGamePage()

readonly statisticsPage = new TranslationStatisticsPage()

readonly statistics = new TranslationStatistics()

readonly countries = new TranslationCountries()
}
7 changes: 7 additions & 0 deletions src/app/common/language/translations/de/de.ui.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class TranslationUI {
buttons = {
previousShort: "Letzte",
nextShort: "Nächste",
finish: "Beenden",
}
}
4 changes: 3 additions & 1 deletion src/app/common/language/translations/translations.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Translation } from "./en/en.translation"
import { TranslationRU } from "./ru/ru.translation"
import { TranslatienDE } from "./de/de.translation"

export function getTranslations(): Translation[] {
const Default = new Translation()
const RU = new TranslationRU()
const DE = new TranslationDE()

return [Default, RU]
return [Default, RU, DE]
}