Browse Source

Add 'are supported by this server' to translatable strings

tags/v0.11.0-beta
Daniel Oaks 6 years ago
parent
commit
ddd7f0dc99
4 changed files with 8 additions and 10 deletions
  1. 2
    0
      irc/client.go
  2. 0
    5
      irc/isupport/list.go
  3. 5
    5
      irc/isupport/list_test.go
  4. 1
    0
      languages/example-irc.lang.json

+ 2
- 0
irc/client.go View File

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

+ 0
- 5
irc/isupport/list.go View File

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

+ 5
- 5
irc/isupport/list_test.go View File

29
 	tListLong.RegenerateCachedReply()
29
 	tListLong.RegenerateCachedReply()
30
 
30
 
31
 	longReplies := [][]string{
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
 	if !reflect.DeepEqual(tListLong.CachedReply, longReplies) {
36
 	if !reflect.DeepEqual(tListLong.CachedReply, longReplies) {
46
 	tList1.Add("RANDKILL", "whenever")
46
 	tList1.Add("RANDKILL", "whenever")
47
 	tList1.RegenerateCachedReply()
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
 	if !reflect.DeepEqual(tList1.CachedReply, expected) {
50
 	if !reflect.DeepEqual(tList1.CachedReply, expected) {
51
 		t.Error("tList1's cached reply does not match expected cached reply")
51
 		t.Error("tList1's cached reply does not match expected cached reply")
52
 	}
52
 	}
60
 	tList2.AddNoValue("STABLEKILL")
60
 	tList2.AddNoValue("STABLEKILL")
61
 	tList2.RegenerateCachedReply()
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
 	if !reflect.DeepEqual(tList2.CachedReply, expected) {
64
 	if !reflect.DeepEqual(tList2.CachedReply, expected) {
65
 		t.Error("tList2's cached reply does not match expected cached reply")
65
 		t.Error("tList2's cached reply does not match expected cached reply")
66
 	}
66
 	}
67
 
67
 
68
 	// compare lists
68
 	// compare lists
69
 	actual := tList1.GetDifference(tList2)
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
 	if !reflect.DeepEqual(actual, expected) {
71
 	if !reflect.DeepEqual(actual, expected) {
72
 		t.Error("difference reply does not match expected difference reply")
72
 		t.Error("difference reply does not match expected difference reply")
73
 	}
73
 	}

+ 1
- 0
languages/example-irc.lang.json View File

137
   "You're not a channel operator": "You're not a channel operator",
137
   "You're not a channel operator": "You're not a channel operator",
138
   "You're not on that channel": "You're not on that channel",
138
   "You're not on that channel": "You're not on that channel",
139
   "Your host is %[1]s, running version %[2]s": "Your host is %[1]s, running version %[2]s",
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
   "can speak these languages": "can speak these languages",
141
   "can speak these languages": "can speak these languages",
141
   "has client certificate fingerprint %s": "has client certificate fingerprint %s",
142
   "has client certificate fingerprint %s": "has client certificate fingerprint %s",
142
   "is a $bBot$b on %s": "is a $bBot$b on %s",
143
   "is a $bBot$b on %s": "is a $bBot$b on %s",

Loading…
Cancel
Save