diff --git a/app/[locale]/(backend)/lib/dailyVerseData.ts b/app/[locale]/(backend)/lib/dailyVerseData.ts new file mode 100644 index 0000000..018d429 --- /dev/null +++ b/app/[locale]/(backend)/lib/dailyVerseData.ts @@ -0,0 +1,32 @@ +// Local data storage for development without DB +// Each object represents a verse for a specific day +export interface localizedContent { + en: string; + de: string; + ru: string; +} + +export interface BibleVerse { + reference: string; + content: localizedContent; +} + +export const bibleVerses: BibleVerse[] = [ + { + reference: "Epheser 2:19", + content: { + en: "So then you are no longer strangers and aliens...", + de: "So seid ihr nun nicht mehr Gäste und Fremdlinge...", + ru: "Итак вы уже не чужие и не пришельцы..." + } + }, + { + reference: "Psalm 23:1", + content: { + en: "The Lord is my shepherd...", + de: "Der Herr ist mein Hirte...", + ru: "Господь — Пастырь мой..." + } + }, + // Add as many as you want here +]; \ No newline at end of file diff --git a/app/[locale]/(backend)/page.tsx b/app/[locale]/(backend)/page.tsx index 1029ffb..a4dbec6 100644 --- a/app/[locale]/(backend)/page.tsx +++ b/app/[locale]/(backend)/page.tsx @@ -22,11 +22,26 @@ import { Users, } from "lucide-react"; import { useTranslations } from "next-intl"; +import { useParams } from "next/navigation"; import Link from "next/link"; import React from "react"; +import { bibleVerses, localizedContent } from "./lib/dailyVerseData"; const Dashboard: React.FC = () => { + // 1. Get a unique number for the current day + const today = new Date(); + today.setHours(0, 0, 0, 0); // Normalize to midnight + const dayTimestamp = today.getTime(); + + // 2. Use the timestamp to get a consistent index + // The modulo (%) operator ensures the index is always within array bounds + const verseIndex = dayTimestamp % bibleVerses.length; + const todayVerse = bibleVerses[verseIndex]; + const params = useParams(); + const lng = params.locale as keyof localizedContent || "en"; // Default to English if no locale is provided + const t = useTranslations("dashboard"); + const categories: ModuleCategory[] = [ { title: "People & Community", @@ -174,7 +189,12 @@ const Dashboard: React.FC = () => {

{t("title")}

-

{t("welcome")}

+

{t("greeting", { user: "David", church: "Rastatt" })}

+

{t("verse_intro")}

+

+ „{todayVerse.content[lng]}" +

+ ({todayVerse.reference})
@@ -230,7 +250,7 @@ const Dashboard: React.FC = () => { title={item.title} description={item.description} icon={item.icon} - //onClick={() => console.log(`Navigating to ${item.path}`)} + //onClick={() => console.log(`Navigating to ${item.path}`)} /> ))} diff --git a/messages/de.json b/messages/de.json index 42520f6..bf7a664 100644 --- a/messages/de.json +++ b/messages/de.json @@ -10,7 +10,9 @@ }, "dashboard": { "title": "Community-Dashboard", - "welcome": "Willkommen im Admin-Bereich. Verwalten Sie Ihre Community-Ressourcen sicher." + "welcome": "Willkommen im Admin-Bereich. Verwalten Sie Ihre Community-Ressourcen sicher.", + "greeting": "Lieber {user}, deine örtliche Gemeinde {church} begrüßt dich!", + "verse_intro": "Lass dich durch den folgenden Vers ermutigen:" }, "users": { "title": "Benutzer", diff --git a/messages/en.json b/messages/en.json index 5c53416..1042439 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10,7 +10,9 @@ }, "dashboard": { "title": "Community Dashboard", - "welcome": "Welcome to the admin area. Manage your community resources safely." + "welcome": "Welcome to the admin area. Manage your community resources safely.", + "greeting": "Dear {user}, your local community {church} welcomes you!", + "verse_intro": "Let the following verse encourage you:" }, "users": { "title": "Users", diff --git a/messages/ru.json b/messages/ru.json index af4b63d..c92de5d 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -10,7 +10,9 @@ }, "dashboard": { "title": "Community Dashboard", - "welcome": "Добро пожаловать в административный раздел. Безопасно управляйте ресурсами вашего сообщества." + "welcome": "Добро пожаловать в административный раздел. Безопасно управляйте ресурсами вашего сообщества.", + "greeting": "Дорогой {user}, твоя местная община {church} приветствует тебя!", + "verse_intro": "Пусть этот стих подбодрит тебя:" }, "users": { "title": "Пользователи",