Golanguage.go -rw-r--r-- 985 B
1package main
2
3type Language int
4
5func (l Language) String() string {
6 switch l {
7 case English:
8 return "english"
9 case Italian:
10 return "italian"
11 case Portuguese:
12 return "portuguese"
13 case Spanish:
14 return "spanish"
15 }
16 panic("unreachable")
17}
18
19const (
20 English = Language(iota)
21 Italian
22 Portuguese
23 Spanish
24)
25
26// See: https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
27var Languages = map[string]Language{
28 "EN": English,
29 "IT": Italian,
30 "PT": Portuguese,
31 "ES": Spanish,
32}
33
34var Introduction = map[Language]string {
35 English: "Hello! Welcome to Lingua!",
36 Italian: "Salve! Benvenuti a Lingua!",
37}
38
39var SelectNewsSource = map[Language]string {
40 English: "Select a New Source",
41 Italian: "Seleziona un canale",
42}
43
44var SummarizeText = map[Language]string {
45 English: "Summarize the text above into %s",
46 Italian: "Riassumi il testo seguente in %s",
47}
48
49var ScoreText = map[Language]string {
50 English: "Your score was: %d",
51 Italian: "La tua valutazione รจ stata: %d",
52}