summaryrefslogtreecommitdiff
path: root/internal/web
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 17:07:48 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 17:07:48 +0200
commit8a7839cad92a264d68635e4c853347d763b8e457 (patch)
tree223a9d069b8f6762a743645690793cf73f732f24 /internal/web
parent378926240f34759116b19e078d2b2504965f5329 (diff)
downloadlectio-8a7839cad92a264d68635e4c853347d763b8e457.tar.gz
lectio-8a7839cad92a264d68635e4c853347d763b8e457.zip
export: localize calendar title (month name via i18n Months + lectionary label); --ui-lang flag overrides interface/export language (cli + web ?lang=); v0.24.0
Diffstat (limited to 'internal/web')
-rw-r--r--internal/web/server.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/web/server.go b/internal/web/server.go
index 5ebed38..a586534 100644
--- a/internal/web/server.go
+++ b/internal/web/server.go
@@ -345,6 +345,9 @@ func readingsHandler(cfg config.Config) http.HandlerFunc {
// date/lectionary/all/version resolution as the reading pane.
func exportHandler(cfg config.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
+ if l := r.URL.Query().Get("lang"); l != "" {
+ cfg.UILanguage = config.NormalizeUILanguage(l)
+ }
date, lectionary, all, versions, _ := resolveQuery(cfg, r)
secs, dayInfo, loadVersions, err := loadSections(cfg, lectionary, date, all, versions)
if err != nil {
@@ -387,6 +390,9 @@ func exportHandler(cfg config.Config) http.HandlerFunc {
// bad month defaults to the current month.
func calendarHandler(cfg config.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
+ if l := r.URL.Query().Get("lang"); l != "" {
+ cfg.UILanguage = config.NormalizeUILanguage(l)
+ }
t, err := time.Parse("2006-01", r.URL.Query().Get("month"))
if err != nil {
t = time.Now()