From cb3379f41c06a94085c77fe359709b46712850dc Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 27 Jul 2026 14:59:14 +0200 Subject: feat: books.toml -> books.ini, multi-language (add Latin dialect), config-scoped citation display books.ini with [en]/[pl]/[la]; parseBooks reads INI (bible drops go-toml). Latin dialect resolves EF citations (Eccli->Sirach, Apoc->Revelation, Luc...); sigla_style gains 'latin'. Reading citations now DISPLAY in the configured sigla (FormatRef(SiglaLang)), not raw English. One-shot books.toml->books.ini user migration (go-toml now config-only). Web settings editor -> books.ini. --- internal/web/server_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/web/server_test.go') diff --git a/internal/web/server_test.go b/internal/web/server_test.go index 284a454..12542e5 100644 --- a/internal/web/server_test.go +++ b/internal/web/server_test.go @@ -561,19 +561,19 @@ func TestSettingsPostInvalidBooks(t *testing.T) { post.Header.Set("Content-Type", "application/x-www-form-urlencoded") rec := httptest.NewRecorder() srv.ServeHTTP(rec, post) - if rec.Code != 200 || !strings.Contains(rec.Body.String(), "books.toml") { + if rec.Code != 200 || !strings.Contains(rec.Body.String(), "books.ini") { t.Errorf("invalid books should re-render with an error, got %d", rec.Code) } } -func bibleDefaultBooks() []byte { return bible.DefaultBooksTOML() } +func bibleDefaultBooks() []byte { return bible.DefaultBooksINI() } // TestSettingsPostEmptyBooksPreservesFile guards that a submit without a books -// field never clobbers an existing books.toml override. +// field never clobbers an existing books.ini override. func TestSettingsPostEmptyBooksPreservesFile(t *testing.T) { dir := t.TempDir() t.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.toml")) - booksPath := filepath.Join(dir, "books.toml") + booksPath := filepath.Join(dir, "books.ini") original := []byte("[en]\nJohn = [\"Jn\", \"John\"]\n") if err := os.WriteFile(booksPath, original, 0o644); err != nil { t.Fatal(err) @@ -594,7 +594,7 @@ func TestSettingsPostEmptyBooksPreservesFile(t *testing.T) { t.Fatalf("status %d", rec.Code) } if got, _ := os.ReadFile(booksPath); string(got) != string(original) { - t.Errorf("empty books submit clobbered books.toml: got %q", got) + t.Errorf("empty books submit clobbered books.ini: got %q", got) } } -- cgit v1.3