summaryrefslogtreecommitdiff
path: root/internal/i18n/golden_test.go
blob: 5a29097ffd978202dccbf25bf6d6d293d3c313be (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
package i18n

import (
	"reflect"
	"testing"
)

// enUI and plUI are the golden chrome tables. They are the SOURCE the embedded
// lang/en.ini and lang/pl.ini are generated from (TestGenerateLangFiles), and
// TestGoldenMatchesEmbedded asserts the embedded files still parse back to them
// -- so a hand-edit to a lang file that drifts from these is caught.
var enUI = UI{
	Version: map[string]string{
		"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  q quit",
	Loading:               "loading…",
	NoReadingsFor:         "no readings for ",
	ErrorPrefix:           "error: ",
	ErrorHint:             "change date (←/→)",
	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  c go-to  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  / tag  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",
	ReaderJumpChapter:     "go to chapter",
	ReaderJumpChapterKeys: "enter go · esc cancel",
	BannerGospel:          "Gospel",
	BannerReadings:        "Readings",
	BannerConnective:      "for",
	Months:                [12]string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
	CalModern:             "novus ordo calendar",
	CalTraditional:        "traditional roman calendar",
	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",
	NavHome:               "home",
	NavSettings:           "settings",
	NavBookmarks:          "bookmarks",
	WebVerseOptional:      "verse (optional)",
	WebTagsPlaceholder:    "tags, comma-separated",
	WebAddBookmark:        "bookmark",
	WebAllTags:            "all",
	WebNoBookmarks:        "No bookmarks yet.",
	WebDelete:             "delete",
	WebSaved:              "Saved.",
	WebUILang:             "UI language",
	WebSiglaStyle:         "sigla style",
	WebDefaultVersion:     "default version",
	WebVersions:           "versions",
	WebWebVersions:        "web versions",
	WebOffline:            "offline",
	WebWidth:              "width",
	WebPort:               "web port",
	WebPager:              "pager",
	WebSave:               "Save",
	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{
		"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ół  q wyjście",
	Loading:               "ładowanie…",
	NoReadingsFor:         "brak czytań na ",
	ErrorPrefix:           "błąd: ",
	ErrorHint:             "zmień datę (←/→)",
	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ł  c skok  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ń  / tag  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",
	ReaderJumpChapter:     "przejdź do rozdziału",
	ReaderJumpChapterKeys: "enter przejdź · esc anuluj",
	BannerGospel:          "Ewangelia",
	BannerReadings:        "Czytania",
	BannerConnective:      "na",
	Months:                [12]string{"Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"},
	CalModern:             "kalendarz Novus Ordo",
	CalTraditional:        "tradycyjny kalendarz rzymski",
	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ł",
	NavHome:               "strona główna",
	NavSettings:           "ustawienia",
	NavBookmarks:          "zakładki",
	WebVerseOptional:      "werset (opcjonalnie)",
	WebTagsPlaceholder:    "tagi, oddzielone przecinkami",
	WebAddBookmark:        "zakładka",
	WebAllTags:            "wszystkie",
	WebNoBookmarks:        "Brak zakładek.",
	WebDelete:             "usuń",
	WebSaved:              "Zapisano.",
	WebUILang:             "język interfejsu",
	WebSiglaStyle:         "styl sigli",
	WebDefaultVersion:     "wersja domyślna",
	WebVersions:           "wersje",
	WebWebVersions:        "wersje web",
	WebOffline:            "offline",
	WebWidth:              "szerokość",
	WebPort:               "port web",
	WebPager:              "pager",
	WebSave:               "Zapisz",
	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)",
}

func TestGoldenMatchesEmbedded(t *testing.T) {
	if got := Get("en"); !reflect.DeepEqual(got, enUI) {
		t.Errorf("Get(en) != golden enUI:\n got %+v\nwant %+v", got, enUI)
	}
	if got := Get("pl"); !reflect.DeepEqual(got, plUI) {
		t.Errorf("Get(pl) != golden plUI:\n got %+v\nwant %+v", got, plUI)
	}
}