aboutsummaryrefslogtreecommitdiff
path: root/internal/i18n/i18n.go
blob: 2e730ee9d8a84f293e7c9b41aab99dfe6481f1f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
// Package i18n holds lectio's UI-chrome string tables (English and Polish)
// for the ui_language config setting. It localises the chrome only --
// version-column labels, the TUI keybar/messages, the CLI banner words, the
// web control labels, and the modern-lectionary section-heading label words
// -- never the scripture verse text or citation, which stay source-language.
package i18n

// UI is one language's complete set of chrome strings.
type UI struct {
	// Version names each bible version for column headers / prose, keyed by
	// version code (bt, wuj, vul, grb, drb).
	Version map[string]string

	// PartLabel names each modern-lectionary section's heading label word,
	// keyed by liturgy.Section.PartID (pierwsze_czytanie, psalm,
	// drugie_czytanie, aklamacja, ewangelia). The pl entries are the exact
	// prefixes niedziela.pl's scraped headings carry, used by
	// render.LocalizeHeading to recognise and swap the label word while
	// keeping the citation untouched.
	PartLabel map[string]string

	// TUI keybar and status messages. NoReadingsFor and ErrorPrefix each
	// carry their own single trailing space (the TUI concatenates a date or
	// error string directly onto them, no separator added at the call site).
	FooterKeys, Loading, NoReadingsFor, ErrorPrefix, ErrorHint string

	// JumpPrompt is the TUI's "d" date-jump prompt label.
	JumpPrompt string

	// Reader-mode (lectio-ui --reader) chrome.
	ReaderTitle, ReaderPickKeys, ReaderReadKeys, ReaderNoText, ReaderNoMatch string
	// Reader bookmarks: the mark-note prompt, the bookmarks-list title/keybar,
	// and the empty-list note.
	ReaderMarkPrompt, ReaderBookmarksTitle, ReaderBookmarksKeys, ReaderNoBookmarks string
	ReaderMarkVerseKeys, ReaderConfirmDelete, ReaderConfirmKeys                    string
	ReaderMarkNote, ReaderMarkTags, ReaderMarkHelp                                 string

	// CLI banner label words and connective: the banner is
	// "<word> <BannerConnective> <date>" (e.g. "Gospel for 2026-07-22" /
	// "Ewangelia na 2026-07-22").
	BannerGospel, BannerReadings, BannerConnective string

	// Months are the localized month names (index 0 = January), for the
	// exported calendar's title.
	Months [12]string

	// Web control labels.
	Lectionary, OptModern, OptTraditional string
	Parts, OptGospel, OptAll              string
	Layout, OptHorizontal, OptColumns     string
	OptInterlinear, Theme, Mono           string

	// NoInterlinearVerses is the web interlinear pane's note when no
	// requested version could be interleaved for a section.
	NoInterlinearVerses string

	// Web reader (lectio-web /reader) control labels.
	NavReader, WebBook, WebChapter string

	// Export is the web daily-page download label (txt/md/pdf links).
	Export, Calendar string

	// NoReadingsDay is the web error fragment shown when readings.Load
	// returns no sections at all for the requested date.
	NoReadingsDay string

	// NoVersion/NoVersionPartial/NoReference/NoReferenceErr are
	// render.GatherVersion/GatherVerses' lookup/citation-failure blocks,
	// rendered verbatim by cli/tui/web. NoVersion takes the version code;
	// NoVersionPartial takes the version code and the comma-joined missing
	// references; NoReferenceErr takes the underlying error (pl keeps %w so
	// it still wraps, en uses %v -- the verb only controls
	// errors.Unwrap-ability, both format identically via Error()).
	NoVersion, NoVersionPartial, NoReference, NoReferenceErr string
}

// Get returns lang's chrome string set, falling back to English for
// anything other than "pl".
func Get(lang string) UI {
	if lang == "pl" {
		return plUI
	}
	return enUI
}

var enUI = UI{
	Version: map[string]string{
		"bt":  "Biblia Tysiąclecia (niedziela.pl)",
		"wuj": "Wujek (Polish)",
		"vul": "Vulgate (Latin)",
		"grb": "Greek",
		"drb": "Douay-Rheims (English)",
	},
	PartLabel: map[string]string{
		"pierwsze_czytanie": "1st reading",
		"psalm":             "Psalm",
		"drugie_czytanie":   "2nd reading",
		"aklamacja":         "Acclamation",
		"ewangelia":         "Gospel",
	},
	FooterKeys:           "tab/⇧tab version  ←/→ day  d date  j/k scroll  space/b page  g/G top/bottom  r refresh  q quit",
	Loading:              "loading…",
	NoReadingsFor:        "no readings for ",
	ErrorPrefix:          "error: ",
	ErrorHint:            "change date (←/→) or refresh (r)",
	JumpPrompt:           "go to date (YYYY-MM-DD)",
	ReaderTitle:          "reader — pick a book",
	ReaderPickKeys:       "type to filter  ↑/↓ move  enter open  esc quit",
	ReaderReadKeys:       "n/p chapter  tab version  j/k scroll  m mark  b bookmarks  esc books  q quit",
	ReaderNoText:         "(no text in this version)",
	ReaderNoMatch:        "(no matching books)",
	ReaderMarkPrompt:     "note (enter to save, esc to cancel)",
	ReaderBookmarksTitle: "bookmarks",
	ReaderBookmarksKeys:  "j/k move  enter open  d delete  esc back  q quit",
	ReaderNoBookmarks:    "no bookmarks yet — press m while reading",
	ReaderMarkVerseKeys:  "↑/↓ pick verse  enter add note  esc cancel",
	ReaderConfirmDelete:  "Delete this bookmark?",
	ReaderConfirmKeys:    "y = delete    n = cancel",
	ReaderMarkNote:       "note",
	ReaderMarkTags:       "tags",
	ReaderMarkHelp:       "enter save · tab switch field · esc cancel",
	BannerGospel:         "Gospel",
	BannerReadings:       "Readings",
	BannerConnective:     "for",
	Months:               [12]string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
	Lectionary:           "lectionary",
	OptModern:            "modern",
	OptTraditional:       "traditional",
	Parts:                "parts",
	OptGospel:            "Gospel",
	OptAll:               "all parts",
	Layout:               "layout",
	OptHorizontal:        "horizontal",
	OptColumns:           "columns",
	OptInterlinear:       "interlinear",
	Theme:                "theme",
	Mono:                 "mono",
	NoInterlinearVerses:  "(no verses to align)",
	NavReader:            "reader",
	WebBook:              "book",
	WebChapter:           "chapter",
	Export:               "download",
	Calendar:             "month calendar",
	NoReadingsDay:        "no readings for this day",
	NoVersion:            "(not in %s)",
	NoVersionPartial:     "(not in %s: %s)",
	NoReference:          "(no reference)",
	NoReferenceErr:       "(no reference: %v)",
}

var plUI = UI{
	Version: map[string]string{
		"bt":  "Biblia Tysiąclecia (niedziela.pl)",
		"wuj": "Wujek (pol.)",
		"vul": "Wulgata (lac.)",
		"grb": "Grecki",
		"drb": "Douay-Rheims (ang.)",
	},
	PartLabel: map[string]string{
		"pierwsze_czytanie": "1. czytanie",
		"psalm":             "Psalm",
		"drugie_czytanie":   "2. czytanie",
		"aklamacja":         "Aklamacja",
		"ewangelia":         "Ewangelia",
	},
	FooterKeys:           "tab/⇧tab wersja  ←/→ dzień  d data  j/k przewiń  spacja/b strona  g/G góra/dół  r odśwież  q wyjście",
	Loading:              "ładowanie…",
	NoReadingsFor:        "brak czytań na ",
	ErrorPrefix:          "błąd: ",
	ErrorHint:            "zmień datę (←/→) lub odśwież (r)",
	JumpPrompt:           "przejdź do daty (RRRR-MM-DD)",
	ReaderTitle:          "czytnik — wybierz księgę",
	ReaderPickKeys:       "wpisz, by filtrować  ↑/↓ ruch  enter otwórz  esc wyjście",
	ReaderReadKeys:       "n/p rozdział  tab wersja  j/k przewiń  m zakładka  b zakładki  esc księgi  q wyjście",
	ReaderNoText:         "(brak tekstu w tej wersji)",
	ReaderNoMatch:        "(brak pasujących ksiąg)",
	ReaderMarkPrompt:     "notatka (enter zapisz, esc anuluj)",
	ReaderBookmarksTitle: "zakładki",
	ReaderBookmarksKeys:  "j/k ruch  enter otwórz  d usuń  esc wróć  q wyjście",
	ReaderNoBookmarks:    "brak zakładek — naciśnij m podczas czytania",
	ReaderMarkVerseKeys:  "↑/↓ wybierz werset  enter notatka  esc anuluj",
	ReaderConfirmDelete:  "Usunąć zakładkę?",
	ReaderConfirmKeys:    "y = usuń    n = anuluj",
	ReaderMarkNote:       "notatka",
	ReaderMarkTags:       "tagi",
	ReaderMarkHelp:       "enter zapisz · tab pole · esc anuluj",
	BannerGospel:         "Ewangelia",
	BannerReadings:       "Czytania",
	BannerConnective:     "na",
	Months:               [12]string{"Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"},
	Lectionary:           "lekcjonarz",
	OptModern:            "nowy",
	OptTraditional:       "tradycyjny",
	Parts:                "zakres",
	OptGospel:            "Ewangelia",
	OptAll:               "wszystkie części",
	Layout:               "układ",
	OptHorizontal:        "poziomo",
	OptColumns:           "kolumny",
	OptInterlinear:       "interlinearnie",
	Theme:                "motyw",
	Mono:                 "mono",
	NoInterlinearVerses:  "(brak wersetów do zestawienia interlinearnego)",
	NavReader:            "czytnik",
	WebBook:              "księga",
	WebChapter:           "rozdział",
	Export:               "pobierz",
	Calendar:             "kalendarz miesiąca",
	NoReadingsDay:        "brak czytań na ten dzień",
	NoVersion:            "(brak w „%s”)",
	NoVersionPartial:     "(brak w „%s”: %s)",
	NoReference:          "(brak odwołania)",
	NoReferenceErr:       "(brak odwołania: %w)",
}