diff --git a/astro.config.mts b/astro.config.mts index e04eb39b..6ca52ef4 100644 --- a/astro.config.mts +++ b/astro.config.mts @@ -16,7 +16,7 @@ const site = getCoolifyURL(true) || 'https://docs.studiocms.dev/'; export const locales = { en: { label: 'English', lang: 'en' }, es: { label: 'Español', lang: 'es' }, - // de: { label: 'Deutsch', lang: 'de' }, + de: { label: 'Deutsch', lang: 'de' }, // ja: { label: '日本語', lang: 'ja' }, fr: { label: 'Français', lang: 'fr' }, // it: { label: 'Italiano', lang: 'it' }, diff --git a/src/content/i18n/de.json b/src/content/i18n/de.json new file mode 100644 index 00000000..78ec2eb8 --- /dev/null +++ b/src/content/i18n/de.json @@ -0,0 +1,48 @@ +{ + "site-title.labels.docs": "Dokumentation", + "site-title.labels.main-site": "Hauptseite", + "site-title.labels.live-demo": "Live-Demo", + "sponsors.sponsoredby": "Gesponsert von", + "package-catalog.readmore.start": "Weitere Informationen findest du auf der", + "package-catalog.readmore.end": "Dokumentations-Seite", + "integration-labels.changelog": "Changelog", + "contributors.core-packages": "StudioCMS Kern-Pakete", + "contributors.ui-library": "StudioCMS UI-Bibliothek", + "contributors.devapps": "StudioCMS Entwicklungsanwendungen", + "contributors.plugins": "StudioCMS Erweiterungen", + "contributors.documentation": "StudioCMS Dokumentation", + "contributors.website": "StudioCMS Website", + "contributors.bots": "StudioCMS Roboter", + "docsearch.button": "Suche", + "docsearch.shortcutLabel": "Drücke / zum Suchen", + "docsearch.placeholder": "Dokumentation durchsuchen", + "docsearch.searchBox.resetButtonTitle": "Zurücksetzen der Eingabe", + "docsearch.searchBox.resetButtonAriaLabel": "Zurücksetzen der Eingabe", + "docsearch.searchBox.cancelButtonText": "Abbrechen", + "docsearch.searchBox.cancelButtonAriaLabel": "Abbrechen", + "docsearch.searchBox.searchInputLabel": "Suchen", + + "docsearch.startScreen.recentSearchesTitle": "Letzte", + "docsearch.startScreen.noRecentSearchesText": "Keine letzten Suchanfragen", + "docsearch.startScreen.saveRecentSearchButtonTitle": "Diese Suche speichern", + "docsearch.startScreen.removeRecentSearchButtonTitle": "Diese Suche aus dem Verlauf entfernen", + "docsearch.startScreen.favoriteSearchesTitle": "Favorisieren", + "docsearch.startScreen.removeFavoriteSearchButtonTitle": "Diese Suche aus den Favoriten entfernen", + + "docsearch.errorScreen.titleText": "Ergebnisse können nicht abgerufen werden", + "docsearch.errorScreen.helpText": "Du solltest vielleicht deine Netzwerkverbindung überprüfen.", + + "docsearch.footer.selectText": "zum Auswählen", + "docsearch.footer.selectKeyAriaLabel": "Eingabetaste", + "docsearch.footer.navigateText": "zum Navigieren", + "docsearch.footer.navigateUpKeyAriaLabel": "Pfeil nach oben", + "docsearch.footer.navigateDownKeyAriaLabel": "Pfeil nach unten", + "docsearch.footer.closeText": "zum Schließen", + "docsearch.footer.closeKeyAriaLabel": "Escape-Taste", + "docsearch.footer.searchByText": "Suchen nach", + + "docsearch.noResultsScreen.noResultsText": "Keine Ergebnisse für", + "docsearch.noResultsScreen.suggestedQueryText": "Versuche die Suche nach", + "docsearch.noResultsScreen.reportMissingResultsText": "Glaubst du, dass diese Abfrage Ergebnisse liefern sollte?", + "docsearch.noResultsScreen.reportMissingResultsLinkText": "Lass es uns wissen." +} diff --git a/starlight-sidebar/de.json b/starlight-sidebar/de.json new file mode 100644 index 00000000..20e02a0d --- /dev/null +++ b/starlight-sidebar/de.json @@ -0,0 +1,16 @@ +{ + "topic-learn": "Lerne", + "topic-package-catalog": "Paket-Katalog", + "topic-references": "Referenzen", + "start-here": "Beginne hier", + "contributing": "Anleitung für Mitwirkende", + "how-it-works": "StudioCMS verstehen", + "utils": "Utils & Helfer", + "plugins": "Plugins", + "catalog": "Katalog", + "studiocms-plugins": "StudioCMS Plugins", + "community-plugins": "Community-Plugins", + "config-reference": "Konfigurationsreferenz", + "typedoc": "TypeDoc", + "auto-gen": "Automatisch generiert" +} diff --git a/starlight-sidebar/translate.ts b/starlight-sidebar/translate.ts index ab156b1f..6589eb4f 100644 --- a/starlight-sidebar/translate.ts +++ b/starlight-sidebar/translate.ts @@ -2,31 +2,30 @@ * To add a new translation for the sidebar, create a new `.json` in this directory and add * it's name to the `Translations` array below and it will be added as a supported sidebar lang. */ -import fallback from './en.json'; +import fallback from "./en.json"; -const Translations = ['en', 'fr', 'ko'] as const; +const Translations = ["en", "fr", "ko", "de"] as const; type TranslationLangs = (typeof Translations)[number]; const jsonFiles = await Promise.all( - Translations.map(async (t) => { - return { lang: t, data: (await import(/* @vite-ignore */ `./${t}.json`)).default }; - }) + Translations.map(async (t) => { + return { lang: t, data: (await import(/* @vite-ignore */ `./${t}.json`)).default }; + }) ); export const getTranslations = (key: string) => { - const translations = new Map>(); + const translations = new Map>(); - for (const translation of Translations) { - translations.set(translation, jsonFiles.find((t) => t.lang === translation)?.data); - } + for (const translation of Translations) { + translations.set(translation, jsonFiles.find((t) => t.lang === translation)?.data); + } - const toReturnObject: Partial> = {}; + const toReturnObject: Partial> = {}; - for (const [trans, value] of translations.entries()) { - toReturnObject[trans] = - (value[key] as string | undefined) || (fallback[key as keyof typeof fallback] as string); - } + for (const [trans, value] of translations.entries()) { + toReturnObject[trans] = (value[key] as string | undefined) || (fallback[key as keyof typeof fallback] as string); + } - return toReturnObject as Record; + return toReturnObject as Record; };