Skip to content
Merged
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 astro.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
48 changes: 48 additions & 0 deletions src/content/i18n/de.json
Original file line number Diff line number Diff line change
@@ -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."
}
16 changes: 16 additions & 0 deletions starlight-sidebar/de.json
Original file line number Diff line number Diff line change
@@ -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"
}
29 changes: 14 additions & 15 deletions starlight-sidebar/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@
* To add a new translation for the sidebar, create a new `<lang>.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<TranslationLangs, Record<string, string>>();
const translations = new Map<TranslationLangs, Record<string, string>>();

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<Record<TranslationLangs, string>> = {};
const toReturnObject: Partial<Record<TranslationLangs, string>> = {};

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<TranslationLangs, string>;
return toReturnObject as Record<TranslationLangs, string>;
};
Loading