summaryrefslogtreecommitdiff
path: root/internal/web/render_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 22:08:56 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 22:08:56 +0200
commit390f8cb146c69d8d3a0e6e0d76ea3546f30a7611 (patch)
tree99510b1fe2d80bfc1ab26473a53def3318bed256 /internal/web/render_test.go
parent4c776396115c8120c3e1cb8fda993449fcdcd326 (diff)
downloadlectio-390f8cb146c69d8d3a0e6e0d76ea3546f30a7611.tar.gz
lectio-390f8cb146c69d8d3a0e6e0d76ea3546f30a7611.zip
i18n: fix consistency-review gaps in ui_language (en/pl chrome)
Closes six findings from review of the ui_language feature so English mode carries no leftover Polish UI text: - Web: interlinear "no verses" note and the empty-day error fragment now route through i18n instead of being unconditionally Polish. - render.GatherVersion/GatherVerses/resolveRef's four lookup/citation- failure blocks are now lang-aware (resolveRef gained a lang param). - i18n.ErrorPrefix/NoReadingsFor lost a stray extra trailing space, restoring the pre-i18n single-space TUI concatenation. - render.LocalizeHeading now matches a heading's actual leading label text against all known modern pl labels, rather than trusting the label keyed by sec.PartID -- fixes split-feast days where PartID is "drugie_czytanie" but the heading still reads "1. czytanie ...". - cli bannerFor is lang-specific again (pl "na", en "for"), restoring pl's exact pre-i18n wording instead of "--" for both languages. - index.html's <html lang> now follows cfg.UILanguage instead of being hardcoded "pl". gofmt/vet clean, go test ./... green, all three binaries build, no new go.mod deps. Consistency grep across cli/tui/web/render's live source turns up only two non-displayed identifiers (a PartID slug list and a pre-existing incipit-stripping constant on the pl scripture text itself).
Diffstat (limited to 'internal/web/render_test.go')
-rw-r--r--internal/web/render_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/web/render_test.go b/internal/web/render_test.go
index ea44ed2..494cdcd 100644
--- a/internal/web/render_test.go
+++ b/internal/web/render_test.go
@@ -106,6 +106,22 @@ func TestRenderReadingsInterlinearNoVersifiedNote(t *testing.T) {
if strings.Contains(html, "ilverse") {
t.Errorf("expected no ilverse blocks when nothing resolves: %q", html)
}
+ if !strings.Contains(html, "brak wersetów do zestawienia interlinearnego") {
+ t.Errorf("pl no-verses note missing/wrong: %q", html)
+ }
+}
+
+// TestRenderReadingsInterlinearNoVersifiedNoteLang checks the interlinear
+// "no verses to align" note (finding §1) follows lang, not always Polish.
+func TestRenderReadingsInterlinearNoVersifiedNoteLang(t *testing.T) {
+ secs := []liturgy.Section{{Heading: "Bez odwołania", PartID: "ewangelia"}}
+ html := string(RenderReadings(secs, []string{"wuj"}, "new", "interlinear", "en"))
+ if !strings.Contains(html, "(no verses to align)") {
+ t.Errorf("en no-verses note missing/wrong: %q", html)
+ }
+ if strings.Contains(html, "brak wersetów") {
+ t.Errorf("en output should not carry the Polish no-verses note: %q", html)
+ }
}
// TestRenderReadingsLocalizesEN checks that lang="en" localises both the