diff --git a/src/lib/components/LanguageToggle.svelte b/src/lib/components/LanguageToggle.svelte index 82a6793..f56ee6f 100644 --- a/src/lib/components/LanguageToggle.svelte +++ b/src/lib/components/LanguageToggle.svelte @@ -4,7 +4,7 @@ import Toggle from './Toggle.svelte'; // Get the language context (must be created by parent page) - const { showLatin } = getLanguageContext(); + const { showLatin, lang } = getLanguageContext(); // Local state for the checkbox let showBilingual = true; @@ -20,6 +20,11 @@ localStorage.setItem('rosary_showBilingual', showBilingual.toString()); } + // Dynamic label based on URL language + $: label = $lang === 'en' + ? 'Show Latin and English' + : 'Lateinisch und Deutsch anzeigen'; + onMount(() => { // Load from localStorage const saved = localStorage.getItem('rosary_showBilingual'); @@ -34,6 +39,6 @@ diff --git a/src/lib/components/StreakCounter.svelte b/src/lib/components/StreakCounter.svelte index 391b889..14979dd 100644 --- a/src/lib/components/StreakCounter.svelte +++ b/src/lib/components/StreakCounter.svelte @@ -9,14 +9,25 @@ let streak = $state | null>(null); interface Props { streakData?: { length: number; lastPrayed: string | null } | null; + lang?: 'de' | 'en'; } -let { streakData = null }: Props = $props(); +let { streakData = null, lang = 'de' }: Props = $props(); + +const isEnglish = $derived(lang === 'en'); // Derive display values: use store when available, fall back to server data for SSR let displayLength = $derived(streak?.length ?? streakData?.length ?? 0); let prayedToday = $derived(streak?.prayedToday ?? (streakData?.lastPrayed === new Date().toISOString().split('T')[0])); +// Labels need to come after displayLength since they depend on it +const labels = $derived({ + days: isEnglish ? (displayLength === 1 ? 'Day' : 'Days') : (displayLength === 1 ? 'Tag' : 'Tage'), + prayed: isEnglish ? 'Prayed' : 'Gebetet', + prayedToday: isEnglish ? 'Prayed today' : 'Heute gebetet', + ariaLabel: isEnglish ? 'Mark prayer as prayed' : 'Gebet als gebetet markieren' +}); + // Initialize store on mount (client-side only) onMount(() => { streak = getRosaryStreak(); @@ -34,18 +45,18 @@ async function pray() {
- Tag{#if displayLength !== 1}e{/if} + {labels.days}
diff --git a/src/lib/components/prayers/Angelus.svelte b/src/lib/components/prayers/Angelus.svelte deleted file mode 100644 index 81b86bb..0000000 --- a/src/lib/components/prayers/Angelus.svelte +++ /dev/null @@ -1,88 +0,0 @@ - - - - -

- ℣. Angelus Domini nuntiavit Mariae. - ℣. Der Engel des Herrn brachte Maria die Botschaft - ℣. The Angel of the Lord declared unto Mary. - ℟. Et concepit de Spiritu Sancto. - ℟. und sie empfing vom Heiligen Geist. - ℟. And she conceived of the Holy Spirit. -

-
- - - - - - -

- ℣. Ecce ancilla Domini, - ℣. Maria sprach: Siehe, ich bin die Magd des Herrn - ℣. Behold the handmaid of the Lord. - ℟. Fiat mihi secundum verbum tuum. - ℟. mir geschehe nach Deinem Wort. - ℟. Be it done unto me according to thy word. -

-
- - - - - - -

- ℣. Et Verbum caro factum est, - ℣. Und das Wort ist Fleisch geworden - ℣. And the Word was made flesh. - ℟. Et habitavit in nobis. - ℟. und hat unter uns gewohnt. - ℟. And dwelt among us. -

-
- - - - - - -

- ℣. Ora pro nobis, sancta Dei Genetrix, - ℣. Bitte für uns Heilige Gottesmutter - ℣. Pray for us, O holy Mother of God. - ℟. Ut digni efficiamur promissionibus Christi. - ℟. auf dass wir würdig werden der Verheißungen Christi. - ℟. That we may be made worthy of the promises of Christ. -

- - -

- ℣. Oremus. - ℣. Lasset uns beten. - ℣. Let us pray: -

- -

- - Gratiam tuam, quaesumus, Domine, mentibus nostris infunde; ut qui, Angelo nuntiante, - Christi Filii tui incarnationem cognovimus, per passionem eius et crucem ad - resurrectionis gloriam perducamur. Per eumdem Christum Dominum nostrum. Amen. - - - Allmächtiger Gott, gieße deine Gnade in unsere Herzen ein. Durch die Botschaft des - Engels haben wir die Menschwerdung Christi, deines Sohnes, erkannt. Lass uns durch - sein Leiden und Kreuz zur Herrlichkeit der Auferstehung gelangen. Darum bitten wir - durch Christus, unseren Herrn. Amen. - - - Pour forth, we beseech Thee, O Lord, Thy grace into our hearts, that we to whom the - Incarnation of Christ Thy Son was made known by the message of an angel, may by His - Passion and Cross be brought to the glory of His Resurrection. Through the same Christ - Our Lord. Amen. - -

-
diff --git a/src/lib/components/prayers/AveMaria.svelte b/src/lib/components/prayers/AveMaria.svelte index 3433ed3..a2f845a 100644 --- a/src/lib/components/prayers/AveMaria.svelte +++ b/src/lib/components/prayers/AveMaria.svelte @@ -1,29 +1,36 @@

Ave María, grátia plena. Dóminus tecum, Gegrüsset seist du Maria, voll der Gnade; der Herr ist mit dir; + Hail Mary, full of grace. The Lord is with thee. benedícta tu in muliéribus, du bist gebenedeit unter den Frauen, + Blessed art thou amongst women, et benedíctus fructus ventris tui, {#if !mysteryLatin}Jesus.{/if} und gebenedeit ist die Frucht deines Leibes, {#if !mystery}Jesus.{/if} + and blessed is the fruit of thy womb, {#if !mysteryEnglish}Jesus.{/if} {#if mysteryLatin} {mysteryLatin} {/if} {#if mystery} {mystery} - + {/if} + {#if mysteryEnglish} + {mysteryEnglish} {/if}

Sancta María, mater Dei, ora pro nobis peccatóribus, Heilige Maria, Mutter Gottes, bitte für uns Sünder + Holy Mary, Mother of God, pray for us sinners, nunc, et in hora mortis nostræ. Amen. jetzt und in der Stunde unseres Todes. Amen. + now and at the hour of our death. Amen.

diff --git a/src/lib/components/prayers/BruderKlausGebet.svelte b/src/lib/components/prayers/BruderKlausGebet.svelte index 72f6b52..4ff968f 100644 --- a/src/lib/components/prayers/BruderKlausGebet.svelte +++ b/src/lib/components/prayers/BruderKlausGebet.svelte @@ -1,15 +1,24 @@

Mein Herr und mein Gott, + My Lord and my God, nimm alles von mir, + take from me everything was mich hindert zu Dir. + that distances me from Thee.

Mein Herr und mein Gott, + My Lord and my God, gib alles mir, + give me everything was mich führet zu Dir. + that brings me closer to Thee.

Mein Herr und mein Gott, + My Lord and my God, nimm mich mir + detach me from myself und gib mich ganz zu eigen Dir. + to give my all to Thee.

diff --git a/src/lib/components/prayers/Confiteor.svelte b/src/lib/components/prayers/Confiteor.svelte index 2326eb5..e2f097e 100644 --- a/src/lib/components/prayers/Confiteor.svelte +++ b/src/lib/components/prayers/Confiteor.svelte @@ -6,34 +6,48 @@

Confíteor Deo omnipoténti, Ich bekenne Gott, dem Allmächtigen, + I confess to almighty God, beátæ Maríæ semper Vírgini der seligen, allzeit reinen Jungfrau Maria, + to blessed Mary ever Virgin, beáto Michaéli Archángelo, dem hl. Erzengel Michael, + to blessed Michael the Archangel, beáto Ioánni Baptístæ, dem hl. Johannes dem Täufer, + to blessed John the Baptist, sanctis Apóstolis Petro et Paulo, den hll. Aposteln Petrus und Paulus, + to the holy Apostles Peter and Paul, ómnibus Sanctis, et tibi pater: allen Heiligen und dir, Vater, + to all the Saints, and to you, Father, quia paccávi nimis dass ich viel gesündigt habe + that I have sinned exceedingly cogitatióne, verbe et ópere: in Gedanken, Worten und Werken, + in thought, word, and deed: mea culpa, mea culpa, mea máxima cupla. durch meine Schuld, durch meine Schuld, durch meine übergrosse Schuld. + through my fault, through my fault, through my most grievous fault. Ideo precor beátam Maríam semper Vírginem, Darum bitte ich die selige, allzeit reine Jungfrau Maria, + Therefore I beseech the blessed Mary ever Virgin, beátum Michaélem Archángelum, den hl. Erzengel Michael, + blessed Michael the Archangel, beátum Ioánnem Baptístam, dem hl. Johannes den Täufer, + blessed John the Baptist, sanctos Apóstolos Petrum et Paulum, die hll. Apostel Petrus und Paulus, + the holy Apostles Peter and Paul, omnes Sanctos, et te pater, alle Heiligen und dich, Vater, + all the Saints, and you, Father, Oráre pro me ad Dóminum Deum nostrum. für mich zu beten bei Gott unserem Herrn. - -

+ to pray for me to the Lord our God. +

diff --git a/src/lib/components/prayers/Credo.svelte b/src/lib/components/prayers/Credo.svelte index 00842b2..5412e4d 100644 --- a/src/lib/components/prayers/Credo.svelte +++ b/src/lib/components/prayers/Credo.svelte @@ -5,87 +5,124 @@

Credo in unum Deum, Patrem omnipoténtem, - Ich glaub an den einen Gott. Den allmächtigen Vater, - factórem cæli et terræ, - Schöpfer des Himmels und der Erde, - visibílium ómnium et invisibílium. - aller sichtbaren und unsichtbaren Dinge. - Et in unum Dóminum Jesum Christum, - Und an den einen Herrn Jesus Christus, - Fílium Dei unigénitum. - Gottes eingeborenen Sohn. - Et ex Patre natum ante ómnia sǽcula. - Er ist aus dem Vater geboren vor aller Zeit. - Deum de Deo, - Gott von Gott, - lumen de lúmine, - Licht vom Lichte, - Deum verum de Deo vero. - wahrer Gott vom wahren Gott; - Génitum, non factum, - Gezeugt, nicht geschaffen, - consubstantiálem Patri: - eines Wesens mit dem Vater; - per quem ómnia facta sunt. - durch Ihn ist alles geschaffen. - Qui propter nos hómines - Für uns Menschen - et propter nostram salútem - und um unsres Heiles willen - descéndit de cælis. - ist Er vom Himmel herabgestiegen. + Ich glaub an den einen Gott. Den allmächtigen Vater, + I believe in one God, the Father almighty, + factórem cæli et terræ, + Schöpfer des Himmels und der Erde, + maker of heaven and earth, + visibílium ómnium et invisibílium. + aller sichtbaren und unsichtbaren Dinge. + of all things visible and invisible. + Et in unum Dóminum Jesum Christum, + Und an den einen Herrn Jesus Christus, + And in one Lord Jesus Christ, + Fílium Dei unigénitum. + Gottes eingeborenen Sohn. + the Only Begotten Son of God, + Et ex Patre natum ante ómnia sǽcula. + Er ist aus dem Vater geboren vor aller Zeit. + born of the Father before all ages. + Deum de Deo, + Gott von Gott, + God from God, + lumen de lúmine, + Licht vom Lichte, + Light from Light, + Deum verum de Deo vero. + wahrer Gott vom wahren Gott; + true God from true God, + Génitum, non factum, + Gezeugt, nicht geschaffen, + begotten, not made, + consubstantiálem Patri: + eines Wesens mit dem Vater; + consubstantial with the Father; + per quem ómnia facta sunt. + durch Ihn ist alles geschaffen. + through Him all things were made. + Qui propter nos hómines + Für uns Menschen + For us men + et propter nostram salútem + und um unsres Heiles willen + and for our salvation + descéndit de cælis. + ist Er vom Himmel herabgestiegen. + He came down from heaven.

Et incarnátus est de Spíritu Sancto Er hat Fleisch angenommen durch den Hl. Geist + And by the Holy Spirit was incarnate ex María Vírgine: aus Maria, der Jungfrau + of the Virgin Mary, Et homo factus est. und ist Mensch geworden. + and became man. Crucifíxus étiam pro nobis: Gekreuzigt wurde Er sogar für uns; + For our sake He was crucified sub Póntio Piláto passus, et sepúltus est. unter Pontius Pilatus hat Er den Tod erlitten und ist begraben worden + under Pontius Pilate, He suffered death and was buried.

Et resurréxit tértia die, Er ist auferstanden am dritten Tage, + And rose again on the third day secúndum Scriptúras. gemäss der Schrift; + in accordance with the Scriptures. Et ascéndit in cáelum: Er ist aufgefahren in den Himmel + He ascended into heaven sedet ad déxteram Patris. und sitzet zur Rechten des Vaters. + and is seated at the right hand of the Father.

Et íterum ventúrus est cum glória Er wird wiederkommen in Herrlichkeit, + He will come again in glory judicáre vivos et mórtuos: Gericht zu halten über Lebende und Tote: + to judge the living and the dead cujus regni non erit finis. und Seines Reiches wird kein Endes sein. + and His kingdom will have no end.

Et in Spíritum Sanctum, Ich glaube an den Heiligen Geist, + I believe in the Holy Spirit, Dóminum et vivificántem: den Herrn und Lebensspender, + the Lord, the giver of life, qui ex Patre Filióque procédit. der vom Vater und vom Sohne ausgeht. + who proceeds from the Father and the Son, Qui cum Patre et Fílio simul adorátur et conglorificátur: zugleich angebetet und verherrlicht; + who with the Father and the Son is adored and glorified, qui locútus est per Prophétas. Er hat gesprochen durch die Propheten. + who has spoken through the prophets. Et unam sanctam cathólicam et apostólicam Ecclésiam. Ich glaube an die eine, heilige, katholische und apostolische Kirche. + I believe in one, holy, catholic and apostolic Church. Confíteor unum baptísma Ich bekenne die eine Taufe + I confess one Baptism in remissiónem peccatórum. zur Vergebung der Sünden. + for the forgiveness of sins Et exspécto resurrectiónem mortuórum. Ich erwarte die Auferstehung der Toten. + and I look forward to the resurrection of the dead Et vitam ventúri sǽculi. Amen. Und das Leben der zukünftigen Welt. Amen. + and the life of the world to come. Amen.

diff --git a/src/lib/components/prayers/FatimaGebet.svelte b/src/lib/components/prayers/FatimaGebet.svelte index c72df2c..227d908 100644 --- a/src/lib/components/prayers/FatimaGebet.svelte +++ b/src/lib/components/prayers/FatimaGebet.svelte @@ -6,13 +6,18 @@

Jésú, indúlge peccáta nostra, O mein Jesus, verzeih' uns unsere Sünden, + O my Jesus, forgive us our sins, præsérva nos ab igne inférni, bewahre uns vor den Feuern der Hölle + save us from the fires of hell, duc omnes ad cæli glóriam, und führe alle Seelen in den Himmel, + and lead all souls to heaven, præcípe tua besonders jene, + especially those misericórdia máxime egéntes. Amen. die Deiner Barmherzigkeit am meisten bedürfen. Amen. + who are in most need of Thy mercy. Amen.

diff --git a/src/lib/components/prayers/Gloria.svelte b/src/lib/components/prayers/Gloria.svelte index 2382b28..ab001d9 100644 --- a/src/lib/components/prayers/Gloria.svelte +++ b/src/lib/components/prayers/Gloria.svelte @@ -6,53 +6,78 @@

Glória in excélsis Deo. Ehre sei Gott in der Höhe. + Glory to God in the highest. Et in terra pax homínibus Und auf Erden Friede den Mesnchen, + And on earth peace to men bonæ voluntátis. die guten Willens sind. + of good will. Laudámus te. Wir loben Dich. + We praise Thee. Benedícimus te. Wir preisen Dich. + We bless Thee. Adorámus te. Wir beten Dich an. + We adore Thee. Glorificámus te. Wir verherrlichen Dich. + We glorify Thee. Grátias ágimus tibi Wir sagen Dir Dank + We give Thee thanks propter magnam glóriam tuam. ob Deiner grossen Herrlichkeit. + for Thy great glory. Dómine Deus, Rex cæléstis, Herr und Gott, König des Himmels, + Lord God, heavenly King, Deus Pater omnípotens. Gott allmächtiger Vater! + God the Father almighty. Dómine Fili unigénite, Jesu Christe. Herr Jesus Christus, eingeborener Sohn! + Lord Jesus Christ, the only-begotten Son. Dómine Deus, Agnus Dei, Herr und Gott, Lamm Gottes, + Lord God, Lamb of God, Fílius Patris. Sohn des Vaters! + Son of the Father. Qui tollis peccáta mundi, Du nimmst hinweg die Sünden der Welt: + Thou who takest away the sins of the world, miserére nobis. erbarme Dich unser. + have mercy on us. Qui tollis peccáta mundi, Du nimmst hinwerg die Sünden der Welt. + Thou who takest away the sins of the world, súscipe depreciatiónem nostram. nimm unser Flehen gnädig auf. + receive our prayer. Qui sedes ad déxteram Patris, Du sitzt zur Rechten des Vaters: + Thou who sittest at the right hand of the Father, miserére nobis. erbarme Dich unser. + have mercy on us. Quóniam tu solus Sanctus. Denn Du allein bist der Heilige. + For Thou alone art holy. Tu solus Altíssimus, Du allein der Höchste, + Thou alone art the Most High, Jesu Christe. Jesus Christus, + Jesus Christ. Cum Sancto Spíritu Mit dem Hl. Geiste, + With the Holy Spirit, in glória Dei Patris. Amen. in der Herrlichkeit Gottes des Vaters. Amen. + in the glory of God the Father. Amen.

diff --git a/src/lib/components/prayers/GloriaPatri.svelte b/src/lib/components/prayers/GloriaPatri.svelte index d3b3cb2..77ae5f1 100644 --- a/src/lib/components/prayers/GloriaPatri.svelte +++ b/src/lib/components/prayers/GloriaPatri.svelte @@ -6,9 +6,12 @@

Glória Patri, et Fílio, et Spirítui Sancto. Ehre sei dem Vater und dem Sohne und dem Hl. Geiste. + Glory be to the Father, and to the Son, and to the Holy Spirit. Sicut erat in princípio, et nunc, et semper: Wie es war am Anfang, so auch jetzt und allezeit + As it was in the beginning, is now, and ever shall be, et in sǽcula sæculórum. Amen. und in Ewigkeit. Amen. + world without end. Amen.

diff --git a/src/lib/components/prayers/JosephGebet.svelte b/src/lib/components/prayers/JosephGebet.svelte index d8c7b1e..8362b41 100644 --- a/src/lib/components/prayers/JosephGebet.svelte +++ b/src/lib/components/prayers/JosephGebet.svelte @@ -1,8 +1,14 @@

- Jungfräulicher Vater Jesu, - Reinster Bräutigam Mariä, - Sankt Joseph, bitte Tag für Tag bei Jesus, dem Sohn Gottes. - Seine Kraft und Gnade soll uns stärken, - dass wir siegreich streiten im Leben - und die Krone von Ihm erhalten im Sterben. + Jungfräulicher Vater Jesu, + Virgin Father of Jesus, + Reinster Bräutigam Mariä, + Most pure Spouse of Mary, + Sankt Joseph, bitte Tag für Tag bei Jesus, dem Sohn Gottes. + Saint Joseph, pray each day to Jesus, the Son of God. + Seine Kraft und Gnade soll uns stärken, + May His power and grace strengthen us, + dass wir siegreich streiten im Leben + that we may fight victoriously in life + und die Krone von Ihm erhalten im Sterben. + and receive the crown from Him at death.

diff --git a/src/lib/components/prayers/Kreuzzeichen.svelte b/src/lib/components/prayers/Kreuzzeichen.svelte index f31036c..7c68e35 100644 --- a/src/lib/components/prayers/Kreuzzeichen.svelte +++ b/src/lib/components/prayers/Kreuzzeichen.svelte @@ -6,5 +6,6 @@

In nómine Patris, et Fílii, et Spíritus Sancti. Amen. Im Namen des Vaters und des Sohnes und des Heiligen Geistes. Amen. + In the name of the Father, and of the Son, and of the Holy Spirit. Amen.

diff --git a/src/lib/components/prayers/MichaelGebet.svelte b/src/lib/components/prayers/MichaelGebet.svelte index 3da7502..830351d 100644 --- a/src/lib/components/prayers/MichaelGebet.svelte +++ b/src/lib/components/prayers/MichaelGebet.svelte @@ -1,22 +1,32 @@

Sáncte Míchael Archángele, Heiliger Erzengel Michael, + Saint Michael the Archangel, defénde nos in proélio, verteidige uns im Kampfe! + defend us in battle. cóntra nequítam et insídias Gegen die Bosheit und Nachstellungen + Be our protection against the wickedness diáboli ésto præsídium. des Teufels sei unser Schutz. + and snares of the devil. Ímperet ílli Déus, súpplices deprecámur: »Gott gebiete ihm!«, so bitten wir flehentlich. + May God rebuke him, we humbly pray; tuque, Prínceps milítæ cæléstis, Du aber, Fürst der himmlischen Heerscharen, + and do thou, O Prince of the heavenly host, Sátanam aliósque spíritus malígnos, stosse den Satan und die anderen bösen Geister, + by the power of God, thrust into hell Satan qui ad perditiónem animárum pervagántur in múndo, die in der Welt umhergehen, um die Seelen zu verderben, + and all the evil spirits + who prowl about the world seeking the ruin of souls. divína virtúte, in inférnum detrúde. Amen. durch die Kraft Gottes in die Hölle. Amen. + Amen.

diff --git a/src/lib/components/prayers/Paternoster.svelte b/src/lib/components/prayers/Paternoster.svelte index c3cdc7b..12ae6c9 100644 --- a/src/lib/components/prayers/Paternoster.svelte +++ b/src/lib/components/prayers/Paternoster.svelte @@ -6,21 +6,30 @@

Pater noster, qui es in cælis Vater unser, der Du bist im Himmel, + Our Father, Who art in heaven, Sanctificétur nomen tuum geheiligt werde Dein Name; + hallowed be Thy name; Advéniat regnum tuum zu uns komme Dein Reich; + Thy kingdom come; Fiat volúntas tua, sicut in cælo, et in terra. Dein Wille geschehe, wie im Himmel, also auch auf Erden! + Thy will be done on earth as it is in heaven. Panem nostrum quotidiánum da nobis hódie. Unser tägliches Brot gib uns heute; + Give us this day our daily bread; Et dimítte nobis debíta nostra, und vergib uns unsere Schulden, + and forgive us our trespasses, sicut et nos dimíttimus debitóribus nostris. wie auch wir vergeben unsern Schuldigern; + as we forgive those who trespass against us; Et ne nos indúcas in tentatiónem. und führe uns nicht in Versuchung. + and lead us not into temptation, Sed líbera nos a malo. Amen. Sondern erlöse uns von dem Übel. Amen. + but deliver us from evil. Amen.

diff --git a/src/lib/components/prayers/Prayer.svelte b/src/lib/components/prayers/Prayer.svelte index 171ac9e..5a0a89d 100644 --- a/src/lib/components/prayers/Prayer.svelte +++ b/src/lib/components/prayers/Prayer.svelte @@ -6,14 +6,18 @@ // Get context if available (graceful fallback for standalone usage) let showLatinStore; + let langStore; try { const context = getLanguageContext(); showLatinStore = context.showLatin; + langStore = context.lang; } catch { showLatinStore = null; + langStore = null; } let showLatin = $derived(showLatinStore ? $showLatinStore : true); + let urlLang = $derived(langStore ? $langStore : 'de'); -
+
{@render children?.()}
diff --git a/src/lib/components/prayers/RosaryFinalPrayer.svelte b/src/lib/components/prayers/RosaryFinalPrayer.svelte index 365ef0d..fbc36b4 100644 --- a/src/lib/components/prayers/RosaryFinalPrayer.svelte +++ b/src/lib/components/prayers/RosaryFinalPrayer.svelte @@ -6,25 +6,35 @@

Orémus: Lasset uns beten: + Let us pray:

Déus, cújus Unigénitus, O Gott, dessen eingeborner Sohn + O God, whose only begotten Son, pér vítam, mórtem ét resurrectiónem súam durch sein Leben, seinen Tod und seine Auferstehung + by His life, death, and resurrection, nóbis salútis ætérnæ præmia comparávit: uns die Belohnung des ewigen Lebens verdient hat, + has purchased for us the rewards of eternal life: concéde, quæsumus; verleihe uns, wir bitten dich, + grant, we beseech Thee, út, hæc mystéria sanctíssimo beátæ Maríæ Vírginis Rosário recoléntes; dass wir, indem wir die Geheimisse des heiligen Rosenkranzes der allerseligsten Jungfrau ehren, + that by meditating on these mysteries of the most holy Rosary of the Blessed Virgin Mary, ét imitémur quód cóntinent, was sie enthalten nachahmen + we may imitate what they contain ét quód promíttunt, assequámur. und dadurch erlangen, was uns in denselben verheissen ist. + and obtain what they promise. Pér eúmdem Chrístum Dóminum nóstrum. Durch unsern Herrn Jesus Christus. + Through the same Christ our Lord. Ámen. Amen. + Amen.

diff --git a/src/lib/components/prayers/SalveRegina.svelte b/src/lib/components/prayers/SalveRegina.svelte index 3d5d2b9..8dd323e 100644 --- a/src/lib/components/prayers/SalveRegina.svelte +++ b/src/lib/components/prayers/SalveRegina.svelte @@ -6,28 +6,39 @@

Salve, Regína, Sei gegrüsst, o Königin, + Hail, Holy Queen, máter misericórdiae; Mutter der Barmherzigkeit, + Mother of Mercy, Víta, dulcédo et spes nóstra, sálve. unser Leben, unsre Wonne und unsere Hoffnung, sei gegrüsst! + our life, our sweetness and our hope.

Ad te clamámus, éxsules fílii Hévae. Zu dir rufen wir verbannte Kinder Evas; + To thee do we cry, poor banished children of Eve. Ad te suspirámus, zu dir seufzen wir + To thee do we send up our sighs, geméntes et fléntes in hac lacrimárum válle. trauernd und weinend in diesem Tal der Tränen. + mourning and weeping in this valley of tears. Eia ergo, Advocáta nóstra, Wohlan denn, unsre Fürsprecherin, + Turn then, most gracious advocate, íllos túos misericórdes óculos ad nos convérte. deine barmherzigen Augen wende zu uns + thine eyes of mercy toward us. Et Jésum, benedíctum frúctum véntris túi, und nach diesem Elend zeige uns Jesus, + And after this our exile show unto us nóbis post hoc exsílíum osténde. die gebenedeite Frucht deines Leibes. + the blessed fruit of thy womb, Jesus. O clémens, o pía, o dúlcis Vírgo María. O gütige, o milde, o süsse Jungfrau Maria. + O clement, O loving, O sweet Virgin Mary.

diff --git a/src/lib/contexts/languageContext.js b/src/lib/contexts/languageContext.js index 137c842..9b84cc5 100644 --- a/src/lib/contexts/languageContext.js +++ b/src/lib/contexts/languageContext.js @@ -1,16 +1,31 @@ -import { setContext, getContext } from 'svelte'; +import { setContext, getContext, hasContext } from 'svelte'; import { writable } from 'svelte/store'; const LANGUAGE_CONTEXT_KEY = Symbol('language'); -export function createLanguageContext() { - const showLatin = writable(true); // true = bilingual, false = monolingual +/** + * Creates or updates a language context for prayer components + * @param {Object} options + * @param {'de' | 'en'} options.urlLang - The URL language (de for /glaube, en for /faith) + */ +export function createLanguageContext({ urlLang = 'de' } = {}) { + // Check if context already exists (e.g., during navigation) + if (hasContext(LANGUAGE_CONTEXT_KEY)) { + const existing = getContext(LANGUAGE_CONTEXT_KEY); + // Update the lang store with the new URL language + existing.lang.set(urlLang); + return existing; + } + + const showLatin = writable(true); // true = bilingual (Latin + vernacular), false = monolingual + const lang = writable(urlLang); // 'de' or 'en' based on URL setContext(LANGUAGE_CONTEXT_KEY, { - showLatin + showLatin, + lang }); - return { showLatin }; + return { showLatin, lang }; } export function getLanguageContext() { diff --git a/src/routes/[faithLang=faithLang]/[prayers=prayersLang]/+page.svelte b/src/routes/[faithLang=faithLang]/[prayers=prayersLang]/+page.svelte index 503e0e4..c96ba98 100644 --- a/src/routes/[faithLang=faithLang]/[prayers=prayersLang]/+page.svelte +++ b/src/routes/[faithLang=faithLang]/[prayers=prayersLang]/+page.svelte @@ -17,13 +17,45 @@ import JosephGebet from "$lib/components/prayers/JosephGebet.svelte"; import Confiteor from "$lib/components/prayers/Confiteor.svelte"; + let { data } = $props(); + // Create language context for prayer components - createLanguageContext(); + const langContext = createLanguageContext({ urlLang: data.lang }); + + // Update lang store when data.lang changes (e.g., after navigation) + $effect(() => { + langContext.lang.set(data.lang); + }); + + // Reactive isEnglish based on data.lang + const isEnglish = $derived(data.lang === 'en'); + + const labels = $derived({ + title: isEnglish ? 'Prayers' : 'Gebete', + description: isEnglish + ? 'Catholic prayers in Latin and English.' + : 'Katholische Gebete auf Deutsch und Latein.', + signOfCross: isEnglish ? 'The Sign of the Cross' : 'Das heilige Kreuzzeichen', + gloriaPatri: 'Glória Patri', + paternoster: isEnglish ? 'Our Father' : 'Paternoster', + credo: isEnglish ? 'Nicene Creed' : 'Credo', + aveMaria: isEnglish ? 'Hail Mary' : 'Ave Maria', + salveRegina: 'Salve Regina', + fatima: isEnglish ? 'Fatima Prayer' : 'Das Fatimagebet', + gloria: 'Glória', + gloriaIntro: isEnglish + ? 'This ancient hymn begins with the words the angels used to celebrate the newborn Savior. It first praises God the Father, then God the Son; it concludes with homage to the Most Holy Trinity, during which one makes the sign of the cross.' + : 'Der uralte Gesang beginnt mit den Worten, mit denen die Engelscharen den neugeborenen Welterlöser feierten. Er preist zunächst Gott Vater, dann Gott Sohn; er schliesst mit einer Huldigung an die Heiligste Dreifaltigkeit, wobei man sich mit dem grossen Kreuze bezeichnet.', + michael: isEnglish ? 'Prayer to St. Michael the Archangel' : 'Gebet zum hl. Erzengel Michael', + bruderKlaus: isEnglish ? 'Prayer of St. Nicholas of Flüe' : 'Bruder Klaus Gebet', + joseph: isEnglish ? 'Prayer to St. Joseph by Pope St. Pius X' : 'Josephgebet des hl. Papst Pius X', + confiteor: isEnglish ? 'The Confiteor' : 'Das Confiteor' + }); - Gebete - Bocken - + {labels.title} - Bocken + -

Gebete

+

{labels.title}

@@ -64,52 +96,52 @@ h1{
- + - + - + - + - + - + - + - -

Der uralte Gesang beginnt mit den Worten, mit denen die Engelscharen den neugeborenen Welterlöser feierten. Er preist zunächst Gott Vater, dann Gott Sohn; er schliesst mit einer Huldigung an die Heiligste Dreifaltigkeit, wobei man sich mit dem grossen Kreuze bezeichnet.

+ +

{labels.gloriaIntro}

- + - + - + - +
diff --git a/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte b/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte index c774ed0..d9e8661 100644 --- a/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte +++ b/src/routes/[faithLang=faithLang]/[rosary=rosaryLang]/+page.svelte @@ -83,6 +83,38 @@ const mysteriesLatin = { ] }; +// English mysteries (TODO: translate) +const mysteriesEnglish = { + freudenreich: [ + "Jesus, whom thou, O Virgin, didst conceive of the Holy Spirit.", + "Jesus, whom thou, O Virgin, didst carry to Elizabeth.", + "Jesus, whom thou, O Virgin, didst bring forth in Bethlehem.", + "Jesus, whom thou, O Virgin, didst present in the Temple.", + "Jesus, whom thou, O Virgin, didst find in the Temple." + ], + schmerzhaften: [ + "Jesus, who sweat blood for us.", + "Jesus, who was scourged for us.", + "Jesus, who was crowned with thorns for us.", + "Jesus, who carried the heavy cross for us.", + "Jesus, who was crucified for us." + ], + glorreichen: [ + "Jesus, who rose from the dead.", + "Jesus, who ascended into heaven.", + "Jesus, who sent us the Holy Spirit.", + "Jesus, who took thee, O Virgin, into heaven.", + "Jesus, who crowned thee, O Virgin, in heaven." + ], + lichtreichen: [ + "Jesus, who was baptized by John.", + "Jesus, who revealed Himself at the wedding in Cana.", + "Jesus, who proclaimed the Kingdom of God.", + "Jesus, who was transfigured on the mountain.", + "Jesus, who gave us the Eucharist." + ] +}; + // Short titles for mysteries (for display in headings) const mysteryTitles = { freudenreich: [ @@ -115,6 +147,38 @@ const mysteryTitles = { ] }; +// English short titles for mysteries (TODO: translate) +const mysteryTitlesEnglish = { + freudenreich: [ + "Annunciation", + "Visitation", + "Nativity", + "Presentation", + "Finding in the Temple" + ], + schmerzhaften: [ + "Agony in the Garden", + "Scourging", + "Crowning with Thorns", + "Carrying of the Cross", + "Crucifixion" + ], + glorreichen: [ + "Resurrection", + "Ascension", + "Descent of the Holy Spirit", + "Assumption of Mary", + "Coronation of Mary" + ], + lichtreichen: [ + "Baptism", + "Wedding at Cana", + "Proclamation of the Kingdom", + "Transfiguration", + "Institution of the Eucharist" + ] +}; + // Toggle for including Luminous mysteries let includeLuminous = $state(true); @@ -122,7 +186,47 @@ let includeLuminous = $state(true); let hasLoadedFromStorage = false; // Create language context for prayer components (LanguageToggle will use this) -createLanguageContext(); +const langContext = createLanguageContext({ urlLang: data.lang }); + +// Update lang store when data.lang changes (e.g., after navigation) +$effect(() => { + langContext.lang.set(data.lang); +}); + +// UI labels based on URL language (reactive) +const isEnglish = $derived(data.lang === 'en'); +const labels = $derived({ + pageTitle: isEnglish ? 'Interactive Rosary' : 'Interaktiver Rosenkranz', + pageDescription: isEnglish + ? 'Interactive digital version of the Rosary for praying along. Scroll through the prayers and follow the visualization.' + : 'Interaktive digitale Version des Rosenkranzes zum Mitbeten. Scrolle durch die Gebete und folge der Visualisierung.', + mysteries: isEnglish ? 'Mysteries' : 'Geheimnisse', + today: isEnglish ? 'Today' : 'Heutige', + joyful: isEnglish ? 'Joyful' : 'Freudenreiche', + sorrowful: isEnglish ? 'Sorrowful' : 'Schmerzhaften', + glorious: isEnglish ? 'Glorious' : 'Glorreichen', + luminous: isEnglish ? 'Luminous' : 'Lichtreichen', + includeLuminous: isEnglish ? 'Include Luminous Mysteries' : 'Lichtreiche Geheimnisse einbeziehen', + beginning: isEnglish ? 'Beginning' : 'Anfang', + signOfCross: isEnglish ? '♱ Sign of the Cross' : '♱ Das Kreuzzeichen', + ourFather: isEnglish ? 'Our Father' : 'Vater unser', + hailMary: isEnglish ? 'Hail Mary' : 'Ave Maria', + faith: isEnglish ? 'Faith' : 'Glaube', + hope: isEnglish ? 'Hope' : 'Hoffnung', + love: isEnglish ? 'Love' : 'Liebe', + decade: isEnglish ? 'Decade' : 'Gesätz', + optional: isEnglish ? 'optional' : 'optional', + gloriaPatri: 'Gloria Patri', + fatimaPrayer: isEnglish ? 'Fatima Prayer' : 'Das Fatima Gebet', + conclusion: isEnglish ? 'Conclusion' : 'Abschluss', + finalPrayer: isEnglish ? 'Final Prayer' : 'Schlussgebet', + footnoteSign: isEnglish ? 'Make the Sign of the Cross here' : 'Hier das Kreuzzeichen machen', + footnoteBow: isEnglish ? 'Bow the head here' : 'Hier den Kopf senken', + showBibleVerse: isEnglish ? 'Show Bible verse' : 'Bibelstelle anzeigen', + mysteryFaith: isEnglish ? 'Jesus, who may increase our faith' : 'Jesus, der in uns den Glauben vermehre', + mysteryHope: isEnglish ? 'Jesus, who may strengthen our hope' : 'Jesus, der in uns die Hoffnung stärke', + mysteryLove: isEnglish ? 'Jesus, who may kindle our love' : 'Jesus, der in uns die Liebe entzünde' +}); // Save luminous toggle state to localStorage whenever it changes (but only after initial load) $effect(() => { @@ -170,7 +274,8 @@ let todaysMystery = $state(initialMystery); // Track today's auto-selected myste // Derive these values from selectedMystery so they update automatically let currentMysteries = $derived(mysteries[selectedMystery]); let currentMysteriesLatin = $derived(mysteriesLatin[selectedMystery]); -let currentMysteryTitles = $derived(mysteryTitles[selectedMystery]); +let currentMysteriesEnglish = $derived(mysteriesEnglish[selectedMystery]); +let currentMysteryTitles = $derived(isEnglish ? mysteryTitlesEnglish[selectedMystery] : mysteryTitles[selectedMystery]); let currentMysteryDescriptions = $derived(data.mysteryDescriptions[selectedMystery] || []); // Function to switch mysteries @@ -1125,15 +1230,15 @@ h1 { } - Interaktiver Rosenkranz - + {labels.pageTitle} +
-

Interaktiver Rosenkranz

+

{labels.pageTitle}

-

Geheimnisse

+

{labels.mysteries}

{#if includeLuminous} @@ -1198,7 +1303,7 @@ q0 -31 22 -54.5t52 -23.5q31 0 52.5 23.5t21.5 54.5zM596 888q0 34 -34 34q-30 0 -30 onclick={() => selectMystery('lichtreichen')} > {#if todaysMystery === 'lichtreichen'} - Heutige + {labels.today} {/if} -

Lichtreichen

+

{labels.luminous}

{/if}
- +
@@ -1318,14 +1423,14 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.cross} data-section="cross" > -

Anfang

-

♱ Das Kreuzzeichen

+

{labels.beginning}

+

{labels.signOfCross}

Credo

-

Hier das Kreuzzeichen machen

-

Hier den Kopf senken

+

{labels.footnoteSign}

+

{labels.footnoteBow}

@@ -1335,7 +1440,7 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.lbead1} data-section="lbead1" > -

Vater unser

+

{labels.ourFather}

@@ -1345,10 +1450,11 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.start1} data-section="start1" > -

Ave Maria: Glaube

+

{labels.hailMary}: {labels.faith}

@@ -1358,10 +1464,11 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.start2} data-section="start2" > -

Ave Maria: Hoffnung

+

{labels.hailMary}: {labels.hope}

@@ -1371,10 +1478,11 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.start3} data-section="start3" > -

Ave Maria: Liebe

+

{labels.hailMary}: {labels.love}

@@ -1384,9 +1492,9 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.lbead2} data-section="lbead2" > -

Gloria Patri

+

{labels.gloriaPatri}

-

Vater unser

+

{labels.ourFather}

@@ -1398,13 +1506,14 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements[`secret${decadeNum}`]} data-section={`secret${decadeNum}`} > -

{decadeNum}. Gesätz: {currentMysteryTitles[decadeNum - 1]}

+

{decadeNum}. {labels.decade}: {currentMysteryTitles[decadeNum - 1]}

-

Ave Maria (10×)

+

{labels.hailMary} (10×)

@@ -1415,7 +1524,7 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 @@ -1431,13 +1540,13 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements[`secret${decadeNum}_transition`]} data-section={`secret${decadeNum}_transition`} > -

Gloria Patri

+

{labels.gloriaPatri}

-

Das Fatima Gebet (optional)

+

{labels.fatimaPrayer} ({labels.optional})

-

Vater unser

+

{labels.ourFather}

{/if} @@ -1449,23 +1558,23 @@ l536 389l-209 -629zM1671 934l-370 267l150 436l-378 -271l-371 271q8 -34 15 -68q10 bind:this={sectionElements.final_transition} data-section="final_transition" > -

Abschluss

+

{labels.conclusion}

-

Gloria Patri

+

{labels.gloriaPatri}

-

Das Fatima Gebet (optional)

+

{labels.fatimaPrayer} ({labels.optional})

Salve Regina

-

Schlussgebet

+

{labels.finalPrayer}

-

Hier das Kreuzzeichen machen

+

{labels.footnoteSign}

diff --git a/src/routes/[faithLang=faithLang]/angelus/+page.svelte b/src/routes/[faithLang=faithLang]/angelus/+page.svelte index 1174949..df1da87 100644 --- a/src/routes/[faithLang=faithLang]/angelus/+page.svelte +++ b/src/routes/[faithLang=faithLang]/angelus/+page.svelte @@ -2,13 +2,19 @@ import { createLanguageContext } from "$lib/contexts/languageContext.js"; import LanguageToggle from "$lib/components/LanguageToggle.svelte"; import Prayer from '$lib/components/prayers/Prayer.svelte'; - import Angelus from "$lib/components/prayers/Angelus.svelte"; import AveMaria from '$lib/components/prayers/AveMaria.svelte'; -import "$lib/css/christ.css"; -import "$lib/css/rosenkranz.css"; + import "$lib/css/christ.css"; + import "$lib/css/rosenkranz.css"; + + let { data } = $props(); // Create language context for prayer components - createLanguageContext(); + const langContext = createLanguageContext({ urlLang: data.lang }); + + // Update lang store when data.lang changes (e.g., after navigation) + $effect(() => { + langContext.lang.set(data.lang); + });