project setup with core files including configuration, package management, and basic structure. Added .gitignore, README, and various TypeScript types for CMS components. Implemented initial components and layouts for the application.

This commit is contained in:
Peter Meier
2025-12-13 23:26:13 +01:00
parent ea288a5bbc
commit b1a556dc6d
167 changed files with 19057 additions and 131 deletions

View File

@@ -0,0 +1,191 @@
/**
* Mock-Daten für Übersetzungen
* Diese können später durch einen echten CMS-Adapter ersetzt werden
*/
export interface Translation {
key: string;
value: string;
namespace?: string;
}
export interface TranslationsData {
locale: string;
translations: Translation[];
}
/**
* Mock-Übersetzungen für Deutsch (de)
*/
export const mockTranslationsDe: TranslationsData = {
locale: "de",
translations: [
// Login Modal
{ key: "login.title", value: "Anmelden", namespace: "auth" },
{ key: "login.email", value: "E-Mail", namespace: "auth" },
{ key: "login.password", value: "Passwort", namespace: "auth" },
{ key: "login.submit", value: "Anmelden", namespace: "auth" },
{ key: "login.loading", value: "Wird geladen...", namespace: "auth" },
{
key: "login.error",
value: "Login fehlgeschlagen. Bitte versuchen Sie es erneut.",
namespace: "auth",
},
{
key: "login.noAccount",
value: "Noch kein Konto?",
namespace: "auth",
},
{
key: "login.registerNow",
value: "Jetzt registrieren",
namespace: "auth",
},
// Register Modal
{ key: "register.title", value: "Registrieren", namespace: "auth" },
{ key: "register.name", value: "Name", namespace: "auth" },
{ key: "register.email", value: "E-Mail", namespace: "auth" },
{ key: "register.password", value: "Passwort", namespace: "auth" },
{
key: "register.confirmPassword",
value: "Passwort bestätigen",
namespace: "auth",
},
{ key: "register.submit", value: "Registrieren", namespace: "auth" },
{
key: "register.loading",
value: "Wird geladen...",
namespace: "auth",
},
{
key: "register.error",
value: "Registrierung fehlgeschlagen. Bitte versuchen Sie es erneut.",
namespace: "auth",
},
{
key: "register.passwordMismatch",
value: "Passwörter stimmen nicht überein",
namespace: "auth",
},
{
key: "register.passwordTooShort",
value: "Passwort muss mindestens 6 Zeichen lang sein",
namespace: "auth",
},
{
key: "register.hasAccount",
value: "Bereits ein Konto?",
namespace: "auth",
},
{
key: "register.loginNow",
value: "Jetzt anmelden",
namespace: "auth",
},
// Navigation
{ key: "nav.login", value: "Anmelden", namespace: "common" },
{ key: "nav.register", value: "Registrieren", namespace: "common" },
{ key: "nav.logout", value: "Abmelden", namespace: "common" },
{ key: "nav.greeting", value: "Hallo, {name}", namespace: "common" },
],
};
/**
* Mock-Übersetzungen für Englisch (en)
*/
export const mockTranslationsEn: TranslationsData = {
locale: "en",
translations: [
// Login Modal
{ key: "login.title", value: "Sign In", namespace: "auth" },
{ key: "login.email", value: "Email", namespace: "auth" },
{ key: "login.password", value: "Password", namespace: "auth" },
{ key: "login.submit", value: "Sign In", namespace: "auth" },
{ key: "login.loading", value: "Loading...", namespace: "auth" },
{
key: "login.error",
value: "Login failed. Please try again.",
namespace: "auth",
},
{
key: "login.noAccount",
value: "Don't have an account?",
namespace: "auth",
},
{
key: "login.registerNow",
value: "Register now",
namespace: "auth",
},
// Register Modal
{ key: "register.title", value: "Register", namespace: "auth" },
{ key: "register.name", value: "Name", namespace: "auth" },
{ key: "register.email", value: "Email", namespace: "auth" },
{ key: "register.password", value: "Password", namespace: "auth" },
{
key: "register.confirmPassword",
value: "Confirm Password",
namespace: "auth",
},
{ key: "register.submit", value: "Register", namespace: "auth" },
{
key: "register.loading",
value: "Loading...",
namespace: "auth",
},
{
key: "register.error",
value: "Registration failed. Please try again.",
namespace: "auth",
},
{
key: "register.passwordMismatch",
value: "Passwords do not match",
namespace: "auth",
},
{
key: "register.passwordTooShort",
value: "Password must be at least 6 characters long",
namespace: "auth",
},
{
key: "register.hasAccount",
value: "Already have an account?",
namespace: "auth",
},
{
key: "register.loginNow",
value: "Sign in now",
namespace: "auth",
},
// Navigation
{ key: "nav.login", value: "Sign In", namespace: "common" },
{ key: "nav.register", value: "Register", namespace: "common" },
{ key: "nav.logout", value: "Logout", namespace: "common" },
{ key: "nav.greeting", value: "Hello, {name}", namespace: "common" },
],
};
/**
* Gibt Übersetzungen für eine bestimmte Locale zurück
*/
export function getTranslations(
locale: string = "de",
namespace?: string
): TranslationsData {
const translations =
locale === "en" ? mockTranslationsEn : mockTranslationsDe;
// Filter nach Namespace, falls angegeben
if (namespace) {
return {
locale: translations.locale,
translations: translations.translations.filter(
(t) => t.namespace === namespace
),
};
}
return translations;
}