summaryrefslogtreecommitdiff
path: root/internal/web
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 09:55:36 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 09:55:36 +0200
commita865374755480a4aef2a6156afccdf08a91422ea (patch)
tree74caa0e64574e491a5620300c3b5544948d0a412 /internal/web
parent1faf9f1b03d7d257307f6ea0500063e4be939d17 (diff)
downloadlectio-a865374755480a4aef2a6156afccdf08a91422ea.tar.gz
lectio-a865374755480a4aef2a6156afccdf08a91422ea.zip
rename the pl scripture version to bt (Biblia Tysiąclecia); v0.4.0
The niedziela.pl scraped Polish paragraph text is the Biblia Tysiąclecia translation; rename its version code from "pl" to "bt" and its i18n label to "Biblia Tysiąclecia (niedziela.pl)" everywhere the scripture VERSION is meant, across config, i18n, render, web, tui, cli and both binaries' help text. Language-role "pl" (ui_language, traditional_lang, i18n.Get lang, --lang validation) is untouched. Behavior is identical -- bt is still dropped for offline/traditional and substituted with wuj.
Diffstat (limited to 'internal/web')
-rw-r--r--internal/web/render.go14
-rw-r--r--internal/web/render_test.go12
-rw-r--r--internal/web/server.go2
-rw-r--r--internal/web/server_test.go10
4 files changed, 19 insertions, 19 deletions
diff --git a/internal/web/render.go b/internal/web/render.go
index 208fc59..1afee1c 100644
--- a/internal/web/render.go
+++ b/internal/web/render.go
@@ -55,7 +55,7 @@ type columnView struct {
// blockView is one paragraph or verse line. VNum is set (and Text holds
// only the verse text) when the block was a bible verse line; otherwise
// VNum is empty and Text holds the whole block, with Refrain set for a
-// responsorial psalm's deduped first ("pl") block.
+// responsorial psalm's deduped first ("bt") block.
type blockView struct {
VNum, Text string
Refrain bool
@@ -89,9 +89,9 @@ type ilLineView struct {
// - "vertical": the same per-version columns side by side in a
// ".display-vertical" grid, like the CLI `compare` view.
// - "interlinear": versions interleaved verse-by-verse by chapter:verse
-// (see buildInterlinearViews); "pl" cannot participate (no verse
+// (see buildInterlinearViews); "bt" cannot participate (no verse
// numbers) and is substituted/dropped via render.OfflineVersions'
-// pl->wuj transform before gathering.
+// bt->wuj transform before gathering.
//
// In every mode, heading, citation (subtitle), verse-number and refrain
// text are wrapped in class="heading|citation|vnum|refrain|version-label"
@@ -140,7 +140,7 @@ func buildColumnViews(secs []liturgy.Section, versions []string, lectionary, lan
bviews := make([]blockView, 0, len(blocks))
for bi, b := range blocks {
// A bible verse line always carries its "chapter:verse "
- // prefix; only text without one (i.e. the "pl" version's
+ // prefix; only text without one (i.e. the "bt" version's
// paragraphs) can be the deduped psalm refrain -- matches
// internal/tui's styleBlock precedence.
if m := verseNumRe.FindStringSubmatch(b); m != nil {
@@ -162,8 +162,8 @@ func buildColumnViews(secs []liturgy.Section, versions []string, lectionary, lan
return views
}
-// interlinearVersions maps versions through the same pl->wuj substitution
-// render.OfflineVersions performs for offline mode: "pl" (niedziela.pl
+// interlinearVersions maps versions through the same bt->wuj substitution
+// render.OfflineVersions performs for offline mode: "bt" (niedziela.pl
// paragraph text) carries no verse numbers and cannot interleave, so it is
// dropped, substituting "wuj" (the Polish-language bible version) in its
// place unless "wuj" was already selected. Reuses render.OfflineVersions
@@ -173,7 +173,7 @@ func interlinearVersions(versions []string) []string {
}
// buildInterlinearViews gathers each requested version's verses via
-// render.GatherVerses (after the pl->wuj substitution, see
+// render.GatherVerses (after the bt->wuj substitution, see
// interlinearVersions) and interleaves them by chapter:verse: the ordered
// union of keys is taken from the first versified version's own verse
// order, then any keys that only appear in a later version are appended in
diff --git a/internal/web/render_test.go b/internal/web/render_test.go
index 494cdcd..b7f5b1e 100644
--- a/internal/web/render_test.go
+++ b/internal/web/render_test.go
@@ -45,7 +45,7 @@ func TestRenderReadingsEscapesScriptText(t *testing.T) {
PartID: "pierwsze_czytanie",
Paragraphs: [][]string{{"<script>alert(1)</script>"}},
}}
- html := string(RenderReadings(secs, []string{"pl"}, "new", "horizontal", "pl"))
+ html := string(RenderReadings(secs, []string{"bt"}, "new", "horizontal", "pl"))
if strings.Contains(html, "<script>alert(1)</script>") {
t.Errorf("raw <script> leaked into rendered output: %q", html)
}
@@ -89,14 +89,14 @@ func TestRenderReadingsInterlinear(t *testing.T) {
}
}
-func TestRenderReadingsInterlinearExcludesPL(t *testing.T) {
+func TestRenderReadingsInterlinearExcludesBT(t *testing.T) {
secs := []liturgy.Section{{Heading: "Ewangelia (J 20, 1. 11-18)", PartID: "ewangelia"}}
- html := string(RenderReadings(secs, []string{"pl", "vul"}, "new", "interlinear", "pl"))
- if strings.Contains(html, "Polski (niedziela.pl)") {
- t.Errorf("interlinear output should substitute wuj for pl, not carry pl's label: %q", html[:min(300, len(html))])
+ html := string(RenderReadings(secs, []string{"bt", "vul"}, "new", "interlinear", "pl"))
+ if strings.Contains(html, "Biblia Tysiąclecia (niedziela.pl)") {
+ t.Errorf("interlinear output should substitute wuj for bt, not carry bt's label: %q", html[:min(300, len(html))])
}
if !strings.Contains(html, "Wujek") {
- t.Errorf("interlinear output should substitute wuj for pl: %q", html[:min(300, len(html))])
+ t.Errorf("interlinear output should substitute wuj for bt: %q", html[:min(300, len(html))])
}
}
diff --git a/internal/web/server.go b/internal/web/server.go
index 3a7517a..110dae7 100644
--- a/internal/web/server.go
+++ b/internal/web/server.go
@@ -28,7 +28,7 @@ import (
// bibleVersions is the fixed, Themes-independent list of scripture versions
// the web UI's checkboxes offer -- independent of any one cfg.Versions, so
// every visitor sees the same five choices regardless of their config file.
-var bibleVersions = []string{"pl", "wuj", "vul", "grb", "drb"}
+var bibleVersions = []string{"bt", "wuj", "vul", "grb", "drb"}
// NewServer builds lectio-web's route tree. cfg supplies the defaults
// (lectionary, versions, theme, offline) that requests can override via
diff --git a/internal/web/server_test.go b/internal/web/server_test.go
index 32ee412..00da039 100644
--- a/internal/web/server_test.go
+++ b/internal/web/server_test.go
@@ -139,18 +139,18 @@ func TestServer(t *testing.T) {
}
})
- t.Run("readings partial interlinear substitutes pl", func(t *testing.T) {
+ t.Run("readings partial interlinear substitutes bt", func(t *testing.T) {
rec := httptest.NewRecorder()
- srv.ServeHTTP(rec, httptest.NewRequest("GET", "/readings?date=2026-07-22&v=pl&display=interlinear", nil))
+ srv.ServeHTTP(rec, httptest.NewRequest("GET", "/readings?date=2026-07-22&v=bt&display=interlinear", nil))
if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want 200", rec.Code)
}
body := rec.Body.String()
if !strings.Contains(body, "Wujek") {
- t.Errorf("pl should be substituted with wuj in interlinear mode: %q", body)
+ t.Errorf("bt should be substituted with wuj in interlinear mode: %q", body)
}
- if strings.Contains(body, "Polski (niedziela.pl)") {
- t.Errorf("pl paragraph column should not appear in interlinear mode: %q", body)
+ if strings.Contains(body, "Biblia Tysiąclecia (niedziela.pl)") {
+ t.Errorf("bt paragraph column should not appear in interlinear mode: %q", body)
}
})