generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages_test.go
78 lines (62 loc) · 1.72 KB
/
messages_test.go
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
package li18ngo_test
import (
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/snivilised/li18ngo"
"github.com/snivilised/li18ngo/locale"
)
// 🧊 Internationalisation
// Internationalisation
type InternationalisationTemplData struct {
li18ngo.TemplData
}
func (td InternationalisationTemplData) Message() *i18n.Message {
return &i18n.Message{
ID: "internationalisation.test",
Description: "Internationalisation",
Other: "internationalisation",
}
}
// 🧊 Localisation
// Internationalisation
type LocalisationTemplData struct {
li18ngo.TemplData
}
func (td LocalisationTemplData) Message() *i18n.Message {
return &i18n.Message{
ID: "localisation.test",
Description: "Localisation",
Other: "localisation",
}
}
type GrafficoData struct{}
func (td GrafficoData) SourceID() string {
return locale.TestGrafficoSourceID
}
// 🧊 Pavement Graffiti Report
// PavementGraffitiReportTemplData
type PavementGraffitiReportTemplData struct {
GrafficoData
Primary string
}
func (td PavementGraffitiReportTemplData) Message() *i18n.Message {
return &i18n.Message{
ID: "pavement-graffiti-report.graffico.test",
Description: "Report of graffiti found on a pavement",
Other: "Found graffiti on pavement; primary colour: '{{.Primary}}'",
}
}
// ☢️ Wrong Source Id
// WrongSourceIDTemplData
type WrongSourceIDTemplData struct {
GrafficoData
}
func (td WrongSourceIDTemplData) SourceID() string {
return "FOO-BAR"
}
func (td WrongSourceIDTemplData) Message() *i18n.Message {
return &i18n.Message{
ID: "wrong-source-id.graffico.test",
Description: "Incorrect Source ID which doesn't match the one in the localizer",
Other: "Message with wrong source ID",
}
}