Browse Source

Ignore some dodgy TL strings, fix another dodgy string

tags/v2.2.0-rc1
Daniel Oaks 3 years ago
parent
commit
fb55cc3390

+ 1
- 1
irc/chanserv.go View File

@@ -249,7 +249,7 @@ func csAmodeHandler(server *Server, client *Client, command string, params []str
249 249
 		}
250 250
 	case modes.Add, modes.Remove:
251 251
 		if len(affectedModes) > 0 {
252
-			csNotice(rb, fmt.Sprintf(client.t("Successfully set persistent mode %s%s on %s"), string(change.Op), string(change.Mode), change.Arg))
252
+			csNotice(rb, fmt.Sprintf(client.t("Successfully set persistent mode %[1]s on %[2]s"), strings.Join([]string{string(change.Op), string(change.Mode)}, ""), change.Arg))
253 253
 			// #729: apply change to current membership
254 254
 			for _, member := range channel.Members() {
255 255
 				if member.Account() == change.Arg {

+ 3
- 0
languages/example/help.lang.json View File

@@ -15,6 +15,7 @@
15 15
   "DEBUG <option>\n\nProvides various debugging commands for the IRCd. <option> can be one of:\n\n* GCSTATS: Garbage control statistics.\n* NUMGOROUTINE: Number of goroutines in use.\n* STARTCPUPROFILE: Starts the CPU profiler.\n* STOPCPUPROFILE: Stops the CPU profiler.\n* PROFILEHEAP: Writes a memory profile.\n* CRASHSERVER: Crashes the server (for use in failover testing)": "DEBUG <option>\n\nProvides various debugging commands for the IRCd. <option> can be one of:\n\n* GCSTATS: Garbage control statistics.\n* NUMGOROUTINE: Number of goroutines in use.\n* STARTCPUPROFILE: Starts the CPU profiler.\n* STOPCPUPROFILE: Stops the CPU profiler.\n* PROFILEHEAP: Writes a memory profile.\n* CRASHSERVER: Crashes the server (for use in failover testing)",
16 16
   "DEOPER\n\nDEOPER removes the IRCop privileges granted to you by a successful /OPER.": "DEOPER\n\nDEOPER removes the IRCop privileges granted to you by a successful /OPER.",
17 17
   "DLINE [ANDKILL] [MYSELF] [duration] <ip>/<net> [ON <server>] [reason [| oper reason]]\nDLINE LIST\n\nBans an IP address or network from connecting to the server. If the duration is\ngiven then only for that long. The reason is shown to the user themselves, but\neveryone else will see a standard message. The oper reason is shown to\noperators getting info about the DLINEs that exist.\n\nBans are saved across subsequent launches of the server.\n\n\"ANDKILL\" means that all matching clients are also removed from the server.\n\n\"MYSELF\" is required when the DLINE matches the address the person applying it is connected\nfrom. If \"MYSELF\" is not given, trying to DLINE yourself will result in an error.\n\n[duration] can be of the following forms:\n\t1y 12mo 31d 10h 8m 13s\n\n<net> is specified in typical CIDR notation. For example:\n\t127.0.0.1/8\n\t8.8.8.8/24\n\nON <server> specifies that the ban is to be set on that specific server.\n\n[reason] and [oper reason], if they exist, are separated by a vertical bar (|).\n\nIf \"DLINE LIST\" is sent, the server sends back a list of our current DLINEs.": "DLINE [ANDKILL] [MYSELF] [duration] <ip>/<net> [ON <server>] [reason [| oper reason]]\nDLINE LIST\n\nBans an IP address or network from connecting to the server. If the duration is\ngiven then only for that long. The reason is shown to the user themselves, but\neveryone else will see a standard message. The oper reason is shown to\noperators getting info about the DLINEs that exist.\n\nBans are saved across subsequent launches of the server.\n\n\"ANDKILL\" means that all matching clients are also removed from the server.\n\n\"MYSELF\" is required when the DLINE matches the address the person applying it is connected\nfrom. If \"MYSELF\" is not given, trying to DLINE yourself will result in an error.\n\n[duration] can be of the following forms:\n\t1y 12mo 31d 10h 8m 13s\n\n<net> is specified in typical CIDR notation. For example:\n\t127.0.0.1/8\n\t8.8.8.8/24\n\nON <server> specifies that the ban is to be set on that specific server.\n\n[reason] and [oper reason], if they exist, are separated by a vertical bar (|).\n\nIf \"DLINE LIST\" is sent, the server sends back a list of our current DLINEs.",
18
+  "EXTJWT <target> [service_name]\n\nGet a JSON Web Token for target (either * or a channel name).": "EXTJWT <target> [service_name]\n\nGet a JSON Web Token for target (either * or a channel name).",
18 19
   "HELP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.": "HELP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.",
19 20
   "HELPOP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.": "HELPOP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.",
20 21
   "HISTORY <target> [limit]\n\nReplay message history. <target> can be a channel name, \"me\" to replay direct\nmessage history, or a nickname to replay another client's direct message\nhistory (they must be logged into the same account as you). [limit] can be\neither an integer (the maximum number of messages to replay), or a time\nduration like 10m or 1h (the time window within which to replay messages).": "HISTORY <target> [limit]\n\nReplay message history. <target> can be a channel name, \"me\" to replay direct\nmessage history, or a nickname to replay another client's direct message\nhistory (they must be logged into the same account as you). [limit] can be\neither an integer (the maximum number of messages to replay), or a time\nduration like 10m or 1h (the time window within which to replay messages).",
@@ -53,12 +54,14 @@
53 54
   "SANICK <currentnick> <newnick>\n\nGives the given user a new nickname.": "SANICK <currentnick> <newnick>\n\nGives the given user a new nickname.",
54 55
   "SCENE <target> <text to be sent>\n\nThe SCENE command is used to send a scene notification to the given target.": "SCENE <target> <text to be sent>\n\nThe SCENE command is used to send a scene notification to the given target.",
55 56
   "SETNAME <realname>\n\nThe SETNAME command updates the realname to be the newly-given one.": "SETNAME <realname>\n\nThe SETNAME command updates the realname to be the newly-given one.",
57
+  "SUMMON [parameters]\n\nThe SUMMON command is not implemented.": "SUMMON [parameters]\n\nThe SUMMON command is not implemented.",
56 58
   "TIME [server]\n\nShows the time of the current, or the given, server.": "TIME [server]\n\nShows the time of the current, or the given, server.",
57 59
   "TOPIC <channel> [topic]\n\nIf [topic] is given, sets the topic in the channel to that. If [topic] is not\ngiven, views the current topic on the channel.": "TOPIC <channel> [topic]\n\nIf [topic] is given, sets the topic in the channel to that. If [topic] is not\ngiven, views the current topic on the channel.",
58 60
   "UNDLINE <ip>/<net>\n\nRemoves an existing ban on an IP address or a network.\n\n<net> is specified in typical CIDR notation. For example:\n\t127.0.0.1/8\n\t8.8.8.8/24": "UNDLINE <ip>/<net>\n\nRemoves an existing ban on an IP address or a network.\n\n<net> is specified in typical CIDR notation. For example:\n\t127.0.0.1/8\n\t8.8.8.8/24",
59 61
   "UNKLINE <mask>\n\nRemoves an existing ban on a mask.\n\nFor example:\n\tdan\n\tdan!5*@127.*": "UNKLINE <mask>\n\nRemoves an existing ban on a mask.\n\nFor example:\n\tdan\n\tdan!5*@127.*",
60 62
   "USER <username> 0 * <realname>\n\nUsed in connection registration, sets your username and realname to the given\nvalues (though your username may also be looked up with Ident).": "USER <username> 0 * <realname>\n\nUsed in connection registration, sets your username and realname to the given\nvalues (though your username may also be looked up with Ident).",
61 63
   "USERHOST <nickname>{ <nickname>}\n\t\t\nShows information about the given users. Takes up to 10 nicknames.": "USERHOST <nickname>{ <nickname>}\n\t\t\nShows information about the given users. Takes up to 10 nicknames.",
64
+  "USERS [parameters]\n\nThe USERS command is not implemented.": "USERS [parameters]\n\nThe USERS command is not implemented.",
62 65
   "VERSION [server]\n\nViews the version of software and the RPL_ISUPPORT tokens for the given server.": "VERSION [server]\n\nViews the version of software and the RPL_ISUPPORT tokens for the given server.",
63 66
   "WEBIRC <password> <gateway> <hostname> <ip> [:<flags>]\n\nUsed by web<->IRC gateways and bouncers, the WEBIRC command allows gateways to\npass-through the real IP addresses of clients:\nircv3.net/specs/extensions/webirc.html\n\n<flags> is a list of space-separated strings indicating various details about\nthe connection from the client to the gateway, such as:\n\n- tls: this flag indicates that the client->gateway connection is secure": "WEBIRC <password> <gateway> <hostname> <ip> [:<flags>]\n\nUsed by web<->IRC gateways and bouncers, the WEBIRC command allows gateways to\npass-through the real IP addresses of clients:\nircv3.net/specs/extensions/webirc.html\n\n<flags> is a list of space-separated strings indicating various details about\nthe connection from the client to the gateway, such as:\n\n- tls: this flag indicates that the client->gateway connection is secure",
64 67
   "WHO <name> [o]\n\nReturns information for the given user.": "WHO <name> [o]\n\nReturns information for the given user.",

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

@@ -95,6 +95,7 @@
95 95
   "Could not accept ownership of channel %s": "Could not accept ownership of channel %s",
96 96
   "Could not delete message": "Could not delete message",
97 97
   "Could not find given client": "Could not find given client",
98
+  "Could not generate EXTJWT token": "Could not generate EXTJWT token",
98 99
   "Could not look up account name, proceeding anyway": "Could not look up account name, proceeding anyway",
99 100
   "Could not parse IP address or CIDR network": "Could not parse IP address or CIDR network",
100 101
   "Could not register": "Could not register",
@@ -109,6 +110,7 @@
109 110
   "Current global users %[1]s, max %[2]s": "Current global users %[1]s, max %[2]s",
110 111
   "Current local users %[1]s, max %[2]s": "Current local users %[1]s, max %[2]s",
111 112
   "Data export for %[1]s completed and written to %[2]s": "Data export for %[1]s completed and written to %[2]s",
113
+  "Device ID:   %s": "Device ID:   %s",
112 114
   "End of /HELPOP": "End of /HELPOP",
113 115
   "End of /INFO": "End of /INFO",
114 116
   "End of /WHOIS list": "End of /WHOIS list",
@@ -165,6 +167,7 @@
165 167
   "Invalid params": "Invalid params",
166 168
   "Invalid regex": "Invalid regex",
167 169
   "Invalid vhost": "Invalid vhost",
170
+  "It was built from git hash %s.": "It was built from git hash %s.",
168 171
   "It was rejected for reason: %s": "It was rejected for reason: %s",
169 172
   "JOIN 0 is not allowed": "JOIN 0 is not allowed",
170 173
   "Language %s is not supported by this server": "Language %s is not supported by this server",
@@ -189,6 +192,7 @@
189 192
   "No such channel": "No such channel",
190 193
   "No such module [%s]": "No such module [%s]",
191 194
   "No such nick": "No such nick",
195
+  "No such service": "No such service",
192 196
   "No such setting": "No such setting",
193 197
   "No text to send": "No text to send",
194 198
   "No topic is set": "No topic is set",
@@ -228,6 +232,7 @@
228 232
   "SASL authentication failed: Passphrase too long": "SASL authentication failed: Passphrase too long",
229 233
   "SASL authentication failed: authcid and authzid should be the same": "SASL authentication failed: authcid and authzid should be the same",
230 234
   "SASL message too long": "SASL message too long",
235
+  "SUMMON has been disabled": "SUMMON has been disabled",
231 236
   "Server notice masks": "Server notice masks",
232 237
   "Session %d (currently attached session):": "Session %d (currently attached session):",
233 238
   "Session %d:": "Session %d:",
@@ -247,7 +252,7 @@
247 252
   "Successfully registered account %s": "Successfully registered account %s",
248 253
   "Successfully rejected vhost request for %s": "Successfully rejected vhost request for %s",
249 254
   "Successfully reset channel access": "Successfully reset channel access",
250
-  "Successfully set persistent mode %s%s on %s": "Successfully set persistent mode %s%s on %s",
255
+  "Successfully set persistent mode %[1]s on %[2]s": "Successfully set persistent mode %[1]s on %[2]s",
251 256
   "Successfully set vhost": "Successfully set vhost",
252 257
   "Successfully transferred channel %[1]s to account %[2]s": "Successfully transferred channel %[1]s to account %[2]s",
253 258
   "Successfully ungrouped nick %s with your account": "Successfully ungrouped nick %s with your account",
@@ -272,6 +277,7 @@
272 277
   "This ban matches you. To KLINE yourself, you must use the command:  /KLINE MYSELF <arguments>": "This ban matches you. To KLINE yourself, you must use the command:  /KLINE MYSELF <arguments>",
273 278
   "This command has been disabled by the server administrators": "This command has been disabled by the server administrators",
274 279
   "This feature has been disabled by the server administrators": "This feature has been disabled by the server administrators",
280
+  "This is Oragono version %s.": "This is Oragono version %s.",
275 281
   "This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.": "This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.",
276 282
   "This server requires that you wait %v after connecting before you can use /LIST. You have %v left.": "This server requires that you wait %v after connecting before you can use /LIST. You have %v left.",
277 283
   "This server was created %s": "This server was created %s",
@@ -285,6 +291,7 @@
285 291
   "Transfer of channel %[1]s to account %[2]s succeeded, pending acceptance": "Transfer of channel %[1]s to account %[2]s succeeded, pending acceptance",
286 292
   "Translators:": "Translators:",
287 293
   "Try again later": "Try again later",
294
+  "USERS has been disabled": "USERS has been disabled",
288 295
   "Unknown command": "Unknown command",
289 296
   "Unknown command. To see available commands, run: /%s HELP": "Unknown command. To see available commands, run: /%s HELP",
290 297
   "Unknown subcommand": "Unknown subcommand",

+ 2
- 3
languages/example/nickserv.lang.json View File

@@ -6,7 +6,7 @@
6 6
   "$bCERT$b controls a user account's certificate fingerprints": "$bCERT$b controls a user account's certificate fingerprints",
7 7
   "$bDM-HISTORY$b\n'dm-history' is only effective for always-on clients. It lets you control\nhow the history of your direct messages is stored. Your options are:\n1. 'off'        [no history]\n2. 'ephemeral'  [a limited amount of temporary history, not stored on disk]\n3. 'on'         [history stored in a permanent database, if available]\n4. 'default'    [use the server default]": "$bDM-HISTORY$b\n'dm-history' is only effective for always-on clients. It lets you control\nhow the history of your direct messages is stored. Your options are:\n1. 'off'        [no history]\n2. 'ephemeral'  [a limited amount of temporary history, not stored on disk]\n3. 'on'         [history stored in a permanent database, if available]\n4. 'default'    [use the server default]",
8 8
   "$bDROP$b de-links your current (or the given) nickname from your user account.": "$bDROP$b de-links your current (or the given) nickname from your user account.",
9
-  "$bENFORCE$b\n'enforce' lets you specify a custom enforcement mechanism for your registered\nnicknames. Your options are:\n1. 'none'    [no enforcement, overriding the server default]\n2. 'timeout' [anyone using the nick must authenticate before a deadline,\n              or else they will be renamed]\n3. 'strict'  [you must already be authenticated to use the nick]\n4. 'default' [use the server default]": "$bENFORCE$b\n'enforce' lets you specify a custom enforcement mechanism for your registered\nnicknames. Your options are:\n1. 'none'    [no enforcement, overriding the server default]\n2. 'timeout' [anyone using the nick must authenticate before a deadline,\n              or else they will be renamed]\n3. 'strict'  [you must already be authenticated to use the nick]\n4. 'default' [use the server default]",
9
+  "$bENFORCE$b\n'enforce' lets you specify a custom enforcement mechanism for your registered\nnicknames. Your options are:\n1. 'none'    [no enforcement, overriding the server default]\n              or else they will be renamed]\n2. 'strict'  [you must already be authenticated to use the nick]\n3. 'default' [use the server default]": "$bENFORCE$b\n'enforce' lets you specify a custom enforcement mechanism for your registered\nnicknames. Your options are:\n1. 'none'    [no enforcement, overriding the server default]\n              or else they will be renamed]\n2. 'strict'  [you must already be authenticated to use the nick]\n3. 'default' [use the server default]",
10 10
   "$bERASE$b erases all records of an account, allowing reuse.": "$bERASE$b erases all records of an account, allowing reuse.",
11 11
   "$bGET$b queries the current values of your account settings": "$bGET$b queries the current values of your account settings",
12 12
   "$bGHOST$b reclaims your nickname.": "$bGHOST$b reclaims your nickname.",
@@ -51,6 +51,5 @@
51 51
   "Syntax: $bSESSIONS [nickname]$b\n\nSESSIONS lists information about the sessions currently attached, via\nthe server's multiclient functionality, to your nickname. An administrator\ncan use this command to list another user's sessions.": "Syntax: $bSESSIONS [nickname]$b\n\nSESSIONS lists information about the sessions currently attached, via\nthe server's multiclient functionality, to your nickname. An administrator\ncan use this command to list another user's sessions.",
52 52
   "Syntax: $bUNREGISTER <username> [code]$b\n\nUNREGISTER lets you delete your user account (or someone else's, if you're an\nIRC operator with the correct permissions). To prevent accidental\nunregistrations, a verification code is required; invoking the command without\na code will display the necessary code.": "Syntax: $bUNREGISTER <username> [code]$b\n\nUNREGISTER lets you delete your user account (or someone else's, if you're an\nIRC operator with the correct permissions). To prevent accidental\nunregistrations, a verification code is required; invoking the command without\na code will display the necessary code.",
53 53
   "Syntax: $bVERIFY <username> <code>$b\n\nVERIFY lets you complete an account registration, if the server requires email\nor other verification.": "Syntax: $bVERIFY <username> <code>$b\n\nVERIFY lets you complete an account registration, if the server requires email\nor other verification.",
54
-  "This nickname is reserved. Please login within %v (using $b/msg NickServ IDENTIFY <password>$b or SASL), or switch to a different nickname.": "This nickname is reserved. Please login within %v (using $b/msg NickServ IDENTIFY <password>$b or SASL), or switch to a different nickname.",
55
-  "You're not logged into an account": "You're not logged into an account",
54
+  "You're not logged into an account": "You're not logged into an account"
56 55
 }

+ 39
- 0
updatetranslations.py View File

@@ -31,6 +31,10 @@ import json
31 31
 from docopt import docopt
32 32
 import yaml
33 33
 
34
+ignored_strings = [
35
+    'none', 'saset'
36
+]
37
+
34 38
 if __name__ == '__main__':
35 39
     arguments = docopt(__doc__, version="0.1.0")
36 40
 
@@ -54,6 +58,13 @@ if __name__ == '__main__':
54 58
                         if match not in irc_strings:
55 59
                             irc_strings.append(match)
56 60
 
61
+        for s in ignored_strings:
62
+            try:
63
+                irc_strings.remove(s)
64
+            except ValueError:
65
+                # ignore any that don't exist
66
+                ...
67
+
57 68
         print("irc strings:", len(irc_strings))
58 69
         with open(os.path.join(arguments['<languages-dir>'], 'example', 'irc.lang.json'), 'w') as f:
59 70
             f.write(json.dumps({k:k for k in irc_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
@@ -77,6 +88,13 @@ if __name__ == '__main__':
77 88
                         if '\n' in match and match not in help_strings:
78 89
                             help_strings.append(match)
79 90
 
91
+        for s in ignored_strings:
92
+            try:
93
+                help_strings.remove(s)
94
+            except ValueError:
95
+                # ignore any that don't exist
96
+                ...
97
+
80 98
         print("help strings:", len(help_strings))
81 99
         with open(os.path.join(arguments['<languages-dir>'], 'example', 'help.lang.json'), 'w') as f:
82 100
             f.write(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
@@ -100,6 +118,13 @@ if __name__ == '__main__':
100 118
                         if match not in help_strings:
101 119
                             help_strings.append(match)
102 120
 
121
+        for s in ignored_strings:
122
+            try:
123
+                help_strings.remove(s)
124
+            except ValueError:
125
+                # ignore any that don't exist
126
+                ...
127
+
103 128
         print("nickserv help strings:", len(help_strings))
104 129
         with open(os.path.join(arguments['<languages-dir>'], 'example', 'nickserv.lang.json'), 'w') as f:
105 130
             f.write(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
@@ -123,6 +148,13 @@ if __name__ == '__main__':
123 148
                         if match not in help_strings:
124 149
                             help_strings.append(match)
125 150
 
151
+        for s in ignored_strings:
152
+            try:
153
+                help_strings.remove(s)
154
+            except ValueError:
155
+                # ignore any that don't exist
156
+                ...
157
+
126 158
         print("chanserv help strings:", len(help_strings))
127 159
         with open(os.path.join(arguments['<languages-dir>'], 'example', 'chanserv.lang.json'), 'w') as f:
128 160
             f.write(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
@@ -146,6 +178,13 @@ if __name__ == '__main__':
146 178
                         if match not in help_strings:
147 179
                             help_strings.append(match)
148 180
 
181
+        for s in ignored_strings:
182
+            try:
183
+                help_strings.remove(s)
184
+            except ValueError:
185
+                # ignore any that don't exist
186
+                ...
187
+
149 188
         print("hostserv help strings:", len(help_strings))
150 189
         with open(os.path.join(arguments['<languages-dir>'], 'example', 'hostserv.lang.json'), 'w') as f:
151 190
             f.write(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))

Loading…
Cancel
Save