Przeglądaj źródła

Add 'are supported by this server' to translatable strings

tags/v0.11.0-beta
Daniel Oaks 6 lat temu
rodzic
commit
ddd7f0dc99

+ 2
- 0
irc/client.go Wyświetl plik

@@ -596,8 +596,10 @@ func (client *Client) LoggedIntoAccount() bool {
596 596
 
597 597
 // RplISupport outputs our ISUPPORT lines to the client. This is used on connection and in VERSION responses.
598 598
 func (client *Client) RplISupport() {
599
+	translatedISupport := client.t("are supported by this server")
599 600
 	for _, tokenline := range client.server.ISupport().CachedReply {
600 601
 		// ugly trickery ahead
602
+		tokenline = append(tokenline, translatedISupport)
601 603
 		client.Send(nil, client.server.name, RPL_ISUPPORT, append([]string{client.nick}, tokenline...)...)
602 604
 	}
603 605
 }

+ 0
- 5
irc/isupport/list.go Wyświetl plik

@@ -8,7 +8,6 @@ import "sort"
8 8
 
9 9
 const (
10 10
 	maxLastArgLength = 400
11
-	supportedString  = "are supported by this server"
12 11
 )
13 12
 
14 13
 // List holds a list of ISUPPORT tokens
@@ -89,7 +88,6 @@ func (il *List) GetDifference(newil *List) [][]string {
89 88
 		}
90 89
 
91 90
 		if len(cache) == 13 || len(token)+length >= maxLastArgLength {
92
-			cache = append(cache, supportedString)
93 91
 			replies = append(replies, cache)
94 92
 			cache = make([]string, 0)
95 93
 			length = 0
@@ -97,7 +95,6 @@ func (il *List) GetDifference(newil *List) [][]string {
97 95
 	}
98 96
 
99 97
 	if len(cache) > 0 {
100
-		cache = append(cache, supportedString)
101 98
 		replies = append(replies, cache)
102 99
 	}
103 100
 
@@ -130,7 +127,6 @@ func (il *List) RegenerateCachedReply() {
130 127
 		}
131 128
 
132 129
 		if len(cache) == 13 || len(token)+length >= maxLastArgLength {
133
-			cache = append(cache, supportedString)
134 130
 			il.CachedReply = append(il.CachedReply, cache)
135 131
 			cache = make([]string, 0)
136 132
 			length = 0
@@ -138,7 +134,6 @@ func (il *List) RegenerateCachedReply() {
138 134
 	}
139 135
 
140 136
 	if len(cache) > 0 {
141
-		cache = append(cache, supportedString)
142 137
 		il.CachedReply = append(il.CachedReply, cache)
143 138
 	}
144 139
 }

+ 5
- 5
irc/isupport/list_test.go Wyświetl plik

@@ -29,8 +29,8 @@ func TestISUPPORT(t *testing.T) {
29 29
 	tListLong.RegenerateCachedReply()
30 30
 
31 31
 	longReplies := [][]string{
32
-		{"1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "are supported by this server"},
33
-		{"E", "F", "are supported by this server"},
32
+		{"1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D"},
33
+		{"E", "F"},
34 34
 	}
35 35
 
36 36
 	if !reflect.DeepEqual(tListLong.CachedReply, longReplies) {
@@ -46,7 +46,7 @@ func TestISUPPORT(t *testing.T) {
46 46
 	tList1.Add("RANDKILL", "whenever")
47 47
 	tList1.RegenerateCachedReply()
48 48
 
49
-	expected := [][]string{{"CASEMAPPING=rfc1459-strict", "EXTBAN", "INVEX=i", "RANDKILL=whenever", "SASL=yes", "are supported by this server"}}
49
+	expected := [][]string{{"CASEMAPPING=rfc1459-strict", "EXTBAN", "INVEX=i", "RANDKILL=whenever", "SASL=yes"}}
50 50
 	if !reflect.DeepEqual(tList1.CachedReply, expected) {
51 51
 		t.Error("tList1's cached reply does not match expected cached reply")
52 52
 	}
@@ -60,14 +60,14 @@ func TestISUPPORT(t *testing.T) {
60 60
 	tList2.AddNoValue("STABLEKILL")
61 61
 	tList2.RegenerateCachedReply()
62 62
 
63
-	expected = [][]string{{"CASEMAPPING=ascii", "EXTBAN=TestBah", "INVEX", "SASL=yes", "STABLEKILL", "are supported by this server"}}
63
+	expected = [][]string{{"CASEMAPPING=ascii", "EXTBAN=TestBah", "INVEX", "SASL=yes", "STABLEKILL"}}
64 64
 	if !reflect.DeepEqual(tList2.CachedReply, expected) {
65 65
 		t.Error("tList2's cached reply does not match expected cached reply")
66 66
 	}
67 67
 
68 68
 	// compare lists
69 69
 	actual := tList1.GetDifference(tList2)
70
-	expected = [][]string{{"-RANDKILL", "CASEMAPPING=ascii", "EXTBAN=TestBah", "INVEX", "STABLEKILL", "are supported by this server"}}
70
+	expected = [][]string{{"-RANDKILL", "CASEMAPPING=ascii", "EXTBAN=TestBah", "INVEX", "STABLEKILL"}}
71 71
 	if !reflect.DeepEqual(actual, expected) {
72 72
 		t.Error("difference reply does not match expected difference reply")
73 73
 	}

+ 1
- 0
languages/example-irc.lang.json Wyświetl plik

@@ -137,6 +137,7 @@
137 137
   "You're not a channel operator": "You're not a channel operator",
138 138
   "You're not on that channel": "You're not on that channel",
139 139
   "Your host is %[1]s, running version %[2]s": "Your host is %[1]s, running version %[2]s",
140
+  "are supported by this server": "are supported by this server",
140 141
   "can speak these languages": "can speak these languages",
141 142
   "has client certificate fingerprint %s": "has client certificate fingerprint %s",
142 143
   "is a $bBot$b on %s": "is a $bBot$b on %s",

Ładowanie…
Anuluj
Zapisz