Browse Source

Update translation framework, add badge to readme

tags/v0.11.0-alpha
Daniel Oaks 6 years ago
parent
commit
75dcff7183
9 changed files with 332 additions and 173 deletions
  1. 1
    0
      README.md
  2. 54
    5
      irc/config.go
  3. 2
    2
      irc/dline.go
  4. 9
    1
      irc/languages.go
  5. 20
    12
      irc/server.go
  6. 65
    0
      languages/example-help.lang.json
  7. 145
    0
      languages/example-irc.lang.json
  8. 8
    145
      languages/example.lang.yaml
  9. 28
    8
      updatetranslations.py

+ 1
- 0
README.md View File

@@ -10,6 +10,7 @@ Oragono is a fork of the [Ergonomadic](https://github.com/edmund-huber/ergonomad
10 10
 [![Build Status](https://travis-ci.org/oragono/oragono.svg?branch=master)](https://travis-ci.org/oragono/oragono)
11 11
 [![Download Latest Release](https://img.shields.io/badge/downloads-latest%20release-green.svg)](https://github.com/oragono/oragono/releases/latest)
12 12
 [![Freenode #oragono](https://img.shields.io/badge/Freenode-%23oragono-1e72ff.svg?style=flat)](https://www.irccloud.com/invite?channel=%23oragono&hostname=irc.freenode.net&port=6697&ssl=1)
13
+[![Crowdin](https://d322cqt584bo4o.cloudfront.net/oragono/localized.svg)](https://crowdin.com/project/oragono)
13 14
 
14 15
 [darwin.network](https://irc.darwin.network/) is running Oragono in production if you want to take a look.
15 16
 

+ 54
- 5
irc/config.go View File

@@ -7,6 +7,7 @@ package irc
7 7
 
8 8
 import (
9 9
 	"crypto/tls"
10
+	"encoding/json"
10 11
 	"errors"
11 12
 	"fmt"
12 13
 	"io/ioutil"
@@ -496,16 +497,18 @@ func LoadConfig(filename string) (config *Config, err error) {
496 497
 				continue
497 498
 			}
498 499
 
499
-			// only load .lang.yaml files
500
+			// only load core .lang.yaml files, and ignore help/irc files
500 501
 			name := f.Name()
501
-			if !strings.HasSuffix(strings.ToLower(name), ".lang.yaml") {
502
+			lowerName := strings.ToLower(name)
503
+			if !strings.HasSuffix(lowerName, ".lang.yaml") {
502 504
 				continue
503 505
 			}
504
-			// don't load our example file in practice
505
-			if strings.ToLower(name) == "example.lang.yaml" {
506
+			// don't load our example files in practice
507
+			if strings.HasPrefix(lowerName, "example") {
506 508
 				continue
507 509
 			}
508 510
 
511
+			// load core info file
509 512
 			data, err = ioutil.ReadFile(filepath.Join(config.Languages.Path, name))
510 513
 			if err != nil {
511 514
 				return nil, fmt.Errorf("Could not load language file [%s]: %s", name, err.Error())
@@ -516,6 +519,52 @@ func LoadConfig(filename string) (config *Config, err error) {
516 519
 			if err != nil {
517 520
 				return nil, fmt.Errorf("Could not parse language file [%s]: %s", name, err.Error())
518 521
 			}
522
+			langInfo.Translations = make(map[string]string)
523
+
524
+			// load actual translation files
525
+			var tlList map[string]string
526
+
527
+			// load irc strings file
528
+			ircName := strings.TrimSuffix(name, ".lang.yaml") + "-irc.lang.json"
529
+
530
+			data, err = ioutil.ReadFile(filepath.Join(config.Languages.Path, ircName))
531
+			if err != nil {
532
+				return nil, fmt.Errorf("Could not load language's irc file [%s]: %s", ircName, err.Error())
533
+			}
534
+
535
+			err = json.Unmarshal(data, &tlList)
536
+			if err != nil {
537
+				return nil, fmt.Errorf("Could not parse language's irc file [%s]: %s", ircName, err.Error())
538
+			}
539
+
540
+			for key, value := range tlList {
541
+				// because of how crowdin works, this is how we skip untranslated lines
542
+				if key == value {
543
+					continue
544
+				}
545
+				langInfo.Translations[key] = value
546
+			}
547
+
548
+			// load help strings file
549
+			helpName := strings.TrimSuffix(name, ".lang.yaml") + "-help.lang.json"
550
+
551
+			data, err = ioutil.ReadFile(filepath.Join(config.Languages.Path, helpName))
552
+			if err != nil {
553
+				return nil, fmt.Errorf("Could not load language's help file [%s]: %s", helpName, err.Error())
554
+			}
555
+
556
+			err = json.Unmarshal(data, &tlList)
557
+			if err != nil {
558
+				return nil, fmt.Errorf("Could not parse language's help file [%s]: %s", helpName, err.Error())
559
+			}
560
+
561
+			for key, value := range tlList {
562
+				// because of how crowdin works, this is how we skip untranslated lines
563
+				if key == value {
564
+					continue
565
+				}
566
+				langInfo.Translations[key] = value
567
+			}
519 568
 
520 569
 			// confirm that values are correct
521 570
 			if langInfo.Code == "en" {
@@ -527,7 +576,7 @@ func LoadConfig(filename string) (config *Config, err error) {
527 576
 			}
528 577
 
529 578
 			if len(langInfo.Translations) == 0 {
530
-				return nil, fmt.Errorf("Language file [%s] contains no translations", name)
579
+				return nil, fmt.Errorf("Language [%s / %s] contains no translations", langInfo.Code, langInfo.Name)
531 580
 			}
532 581
 
533 582
 			// check for duplicate languages

+ 2
- 2
irc/dline.go View File

@@ -372,10 +372,10 @@ func dlineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
372 372
 
373 373
 	var snoDescription string
374 374
 	if durationIsUsed {
375
-		client.Notice(fmt.Sprintf("Added temporary (%s) D-Line for %s", duration.String(), hostString))
375
+		client.Notice(fmt.Sprintf(client.t("Added temporary (%s) D-Line for %s"), duration.String(), hostString))
376 376
 		snoDescription = fmt.Sprintf(ircfmt.Unescape("%s [%s]$r added temporary (%s) D-Line for %s"), client.nick, operName, duration.String(), hostString)
377 377
 	} else {
378
-		client.Notice(fmt.Sprintf("Added D-Line for %s", hostString))
378
+		client.Notice(fmt.Sprintf(client.t("Added D-Line for %s"), hostString))
379 379
 		snoDescription = fmt.Sprintf(ircfmt.Unescape("%s [%s]$r added D-Line for %s"), client.nick, operName, hostString)
380 380
 	}
381 381
 	server.snomasks.Send(sno.LocalXline, snoDescription)

+ 9
- 1
irc/languages.go View File

@@ -34,7 +34,15 @@ func NewLanguageManager(defaultLang string, languageData map[string]LangData) *L
34 34
 	// load language data
35 35
 	for name, data := range languageData {
36 36
 		lm.Info[name] = data
37
-		lm.translations[name] = data.Translations
37
+
38
+		// make sure we don't include empty translations
39
+		lm.translations[name] = make(map[string]string)
40
+		for key, value := range data.Translations {
41
+			if strings.TrimSpace(value) == "" {
42
+				continue
43
+			}
44
+			lm.translations[name][key] = value
45
+		}
38 46
 	}
39 47
 
40 48
 	return &lm

+ 20
- 12
irc/server.go View File

@@ -2235,7 +2235,7 @@ func languageHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
2235 2235
 }
2236 2236
 
2237 2237
 var (
2238
-	infoString = strings.Split(`      ▄▄▄   ▄▄▄·  ▄▄ •        ▐ ▄       
2238
+	infoString1 = strings.Split(`      ▄▄▄   ▄▄▄·  ▄▄ •        ▐ ▄
2239 2239
 ▪     ▀▄ █·▐█ ▀█ ▐█ ▀ ▪▪     •█▌▐█▪     
2240 2240
  ▄█▀▄ ▐▀▀▄ ▄█▀▀█ ▄█ ▀█▄ ▄█▀▄▪▐█▐▐▌ ▄█▀▄ 
2241 2241
 ▐█▌.▐▌▐█•█▌▐█ ▪▐▌▐█▄▪▐█▐█▌ ▐▌██▐█▌▐█▌.▐▌
@@ -2243,17 +2243,11 @@ var (
2243 2243
 
2244 2244
          https://oragono.io/
2245 2245
    https://github.com/oragono/oragono
2246
-
2247
-Oragono is released under the MIT license.
2248
-
2249
-Thanks to Jeremy Latt for founding Ergonomadic, the project this is based on <3
2250
-
2251
-Core Developers:
2252
-    Daniel Oakley,          DanielOaks,    <daniel@danieloaks.net>
2246
+`, "\n")
2247
+	infoString2 = strings.Split(`    Daniel Oakley,          DanielOaks,    <daniel@danieloaks.net>
2253 2248
     Shivaram Lingamneni,    slingamn,      <slingamn@cs.stanford.edu>
2254
-
2255
-Contributors and Former Developers:
2256
-    3onyc
2249
+`, "\n")
2250
+	infoString3 = strings.Split(`    3onyc
2257 2251
     Edmund Huber
2258 2252
     Euan Kemp (euank)
2259 2253
     Jeremy Latt
@@ -2267,7 +2261,21 @@ Contributors and Former Developers:
2267 2261
 )
2268 2262
 
2269 2263
 func infoHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
2270
-	for _, line := range infoString {
2264
+	// we do the below so that the human-readable lines in info can be translated.
2265
+	for _, line := range infoString1 {
2266
+		client.Send(nil, server.name, RPL_INFO, client.nick, line)
2267
+	}
2268
+	client.Send(nil, server.name, RPL_INFO, client.nick, client.t("Oragono is released under the MIT license."))
2269
+	client.Send(nil, server.name, RPL_INFO, client.nick, "")
2270
+	client.Send(nil, server.name, RPL_INFO, client.nick, client.t("Thanks to Jeremy Latt for founding Ergonomadic, the project this is based on <3"))
2271
+	client.Send(nil, server.name, RPL_INFO, client.nick, "")
2272
+	client.Send(nil, server.name, RPL_INFO, client.nick, client.t("Core Developers:"))
2273
+	for _, line := range infoString2 {
2274
+		client.Send(nil, server.name, RPL_INFO, client.nick, line)
2275
+	}
2276
+	client.Send(nil, server.name, RPL_INFO, client.nick, "")
2277
+	client.Send(nil, server.name, RPL_INFO, client.nick, client.t("Contributors and Former Developers:"))
2278
+	for _, line := range infoString3 {
2271 2279
 		client.Send(nil, server.name, RPL_INFO, client.nick, line)
2272 2280
 	}
2273 2281
 	client.Send(nil, server.name, RPL_ENDOFINFO, client.nick, "End of /INFO")

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

@@ -0,0 +1,65 @@
1
+{
2
+  "= Help Topics =\n\nCommands:\n%s\n\nRPL_ISUPPORT Tokens:\n%s\n\nInformation:\n%s": "= Help Topics =\n\nCommands:\n%s\n\nRPL_ISUPPORT Tokens:\n%s\n\nInformation:\n%s",
3
+  "== Channel Modes ==\n\nOragono supports the following channel modes:\n\n  +b  |  Client masks that are banned from the channel (e.g. *!*@127.0.0.1)\n  +e  |  Client masks that are exempted from bans.\n  +I  |  Client masks that are exempted from the invite-only flag.\n  +i  |  Invite-only mode, only invited clients can join the channel.\n  +k  |  Key required when joining the channel.\n  +l  |  Client join limit for the channel.\n  +m  |  Moderated mode, only privileged clients can talk on the channel.\n  +n  |  No-outside-messages mode, only users that are on the channel can send\n      |  messages to it.\n  +r  |  Only registered users can talk in the channel.\n  +s  |  Secret mode, channel won't show up in /LIST or whois replies.\n  +t  |  Only channel opers can modify the topic.\n\n= Prefixes =\n\n  +q (~)  |  Founder channel mode.\n  +a (&)  |  Admin channel mode.\n  +o (@)  |  Operator channel mode.\n  +h (%)  |  Halfop channel mode.\n  +v (+)  |  Voice channel mode.": "== Channel Modes ==\n\nOragono supports the following channel modes:\n\n  +b  |  Client masks that are banned from the channel (e.g. *!*@127.0.0.1)\n  +e  |  Client masks that are exempted from bans.\n  +I  |  Client masks that are exempted from the invite-only flag.\n  +i  |  Invite-only mode, only invited clients can join the channel.\n  +k  |  Key required when joining the channel.\n  +l  |  Client join limit for the channel.\n  +m  |  Moderated mode, only privileged clients can talk on the channel.\n  +n  |  No-outside-messages mode, only users that are on the channel can send\n      |  messages to it.\n  +r  |  Only registered users can talk in the channel.\n  +s  |  Secret mode, channel won't show up in /LIST or whois replies.\n  +t  |  Only channel opers can modify the topic.\n\n= Prefixes =\n\n  +q (~)  |  Founder channel mode.\n  +a (&)  |  Admin channel mode.\n  +o (@)  |  Operator channel mode.\n  +h (%)  |  Halfop channel mode.\n  +v (+)  |  Voice channel mode.",
4
+  "== Server Notice Masks ==\n\nOragono supports the following server notice masks for operators:\n\n  a  |  Local announcements.\n  c  |  Local client connections.\n  j  |  Local channel actions.\n  k  |  Local kills.\n  n  |  Local nick changes.\n  o  |  Local oper actions.\n  q  |  Local quits.\n  t  |  Local /STATS usage.\n  u  |  Local client account actions.\n  x  |  Local X-lines (DLINE/KLINE/etc).\n\nTo set a snomask, do this with your nickname:\n\n  /MODE <nick> +s <chars>\n\nFor instance, this would set the kill, oper, account and xline snomasks on dan:\n\n  /MODE dan +s koux": "== Server Notice Masks ==\n\nOragono supports the following server notice masks for operators:\n\n  a  |  Local announcements.\n  c  |  Local client connections.\n  j  |  Local channel actions.\n  k  |  Local kills.\n  n  |  Local nick changes.\n  o  |  Local oper actions.\n  q  |  Local quits.\n  t  |  Local /STATS usage.\n  u  |  Local client account actions.\n  x  |  Local X-lines (DLINE/KLINE/etc).\n\nTo set a snomask, do this with your nickname:\n\n  /MODE <nick> +s <chars>\n\nFor instance, this would set the kill, oper, account and xline snomasks on dan:\n\n  /MODE dan +s koux",
5
+  "== User Modes ==\n\nOragono supports the following user modes:\n\n  +a  |  User is marked as being away. This mode is set with the /AWAY command.\n  +i  |  User is marked as invisible (their channels are hidden from whois replies).\n  +o  |  User is an IRC operator.\n  +R  |  User only accepts messages from other registered users. \n  +s  |  Server Notice Masks (see help with /HELPOP snomasks).\n  +Z  |  User is connected via TLS.": "== User Modes ==\n\nOragono supports the following user modes:\n\n  +a  |  User is marked as being away. This mode is set with the /AWAY command.\n  +i  |  User is marked as invisible (their channels are hidden from whois replies).\n  +o  |  User is an IRC operator.\n  +R  |  User only accepts messages from other registered users. \n  +s  |  Server Notice Masks (see help with /HELPOP snomasks).\n  +Z  |  User is connected via TLS.",
6
+  "@+client-only-tags TAGMSG <target>{,<target>}\n\nSends the given client-only tags to the given targets as a TAGMSG. See the IRCv3\nspecs for more info: http://ircv3.net/specs/core/message-tags-3.3.html": "@+client-only-tags TAGMSG <target>{,<target>}\n\nSends the given client-only tags to the given targets as a TAGMSG. See the IRCv3\nspecs for more info: http://ircv3.net/specs/core/message-tags-3.3.html",
7
+  "ACC REGISTER <accountname> [callback_namespace:]<callback> [cred_type] :<credential>\nACC VERIFY <accountname> <auth_code>\n\nUsed in account registration. See the relevant specs for more info:\nhttps://oragono.io/specs.html": "ACC REGISTER <accountname> [callback_namespace:]<callback> [cred_type] :<credential>\nACC VERIFY <accountname> <auth_code>\n\nUsed in account registration. See the relevant specs for more info:\nhttps://oragono.io/specs.html",
8
+  "AMBIANCE <target> <text to be sent>\n\nThe AMBIANCE command is used to send a scene notification to the given target.": "AMBIANCE <target> <text to be sent>\n\nThe AMBIANCE command is used to send a scene notification to the given target.",
9
+  "AUTHENTICATE\n\nUsed during SASL authentication. See the IRCv3 specs for more info:\nhttp://ircv3.net/specs/extensions/sasl-3.1.html": "AUTHENTICATE\n\nUsed during SASL authentication. See the IRCv3 specs for more info:\nhttp://ircv3.net/specs/extensions/sasl-3.1.html",
10
+  "AWAY [message]\n\nIf [message] is sent, marks you away. If [message] is not sent, marks you no\nlonger away.": "AWAY [message]\n\nIf [message] is sent, marks you away. If [message] is not sent, marks you no\nlonger away.",
11
+  "CAP <subcommand> [:<capabilities>]\n\nUsed in capability negotiation. See the IRCv3 specs for more info:\nhttp://ircv3.net/specs/core/capability-negotiation-3.1.html\nhttp://ircv3.net/specs/core/capability-negotiation-3.2.html": "CAP <subcommand> [:<capabilities>]\n\nUsed in capability negotiation. See the IRCv3 specs for more info:\nhttp://ircv3.net/specs/core/capability-negotiation-3.1.html\nhttp://ircv3.net/specs/core/capability-negotiation-3.2.html",
12
+  "CHANSERV <subcommand> [params]\n\nChanServ controls channel registrations.": "CHANSERV <subcommand> [params]\n\nChanServ controls channel registrations.",
13
+  "CS <subcommand> [params]\n\nChanServ controls channel registrations.": "CS <subcommand> [params]\n\nChanServ controls channel registrations.",
14
+  "DEBUG <option>\n\nPrints debug information about 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 out the CPU profiler info.": "DEBUG <option>\n\nPrints debug information about 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 out the CPU profiler info.",
15
+  "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.",
16
+  "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.",
17
+  "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.",
18
+  "INFO\n\nSends information about the server, developers, etc.": "INFO\n\nSends information about the server, developers, etc.",
19
+  "INVITE <nickname> <channel>\n\nInvites the given user to the given channel, so long as you have the\nappropriate channel privs.": "INVITE <nickname> <channel>\n\nInvites the given user to the given channel, so long as you have the\nappropriate channel privs.",
20
+  "ISON <nickname>{ <nickname>}\n\nReturns whether the given nicks exist on the network.": "ISON <nickname>{ <nickname>}\n\nReturns whether the given nicks exist on the network.",
21
+  "JOIN <channel>{,<channel>} [<key>{,<key>}]\n\nJoins the given channels with the matching keys.": "JOIN <channel>{,<channel>} [<key>{,<key>}]\n\nJoins the given channels with the matching keys.",
22
+  "KICK <channel> <user> [reason]\n\nRemoves the user from the given channel, so long as you have the appropriate\nchannel privs.": "KICK <channel> <user> [reason]\n\nRemoves the user from the given channel, so long as you have the appropriate\nchannel privs.",
23
+  "KILL <nickname> [reason]\n\nRemoves the given user from the network, showing them the reason if it is\nsupplied.": "KILL <nickname> [reason]\n\nRemoves the given user from the network, showing them the reason if it is\nsupplied.",
24
+  "KLINE [ANDKILL] [MYSELF] [duration] <mask> [ON <server>] [reason [| oper reason]]\nKLINE LIST\n\nBans a mask from connecting to the server. If the duration is given then only for that\nlong. The reason is shown to the user themselves, but everyone else will see a standard\nmessage. The oper reason is shown to operators getting info about the KLINEs 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 KLINE matches the address the person applying it is connected\nfrom. If \"MYSELF\" is not given, trying to KLINE yourself will result in an error.\n\n[duration] can be of the following forms:\n\t1y 12mo 31d 10h 8m 13s\n\n<mask> is specified in typical IRC format. For example:\n\tdan\n\tdan!5*@127.*\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 \"KLINE LIST\" is sent, the server sends back a list of our current KLINEs.": "KLINE [ANDKILL] [MYSELF] [duration] <mask> [ON <server>] [reason [| oper reason]]\nKLINE LIST\n\nBans a mask from connecting to the server. If the duration is given then only for that\nlong. The reason is shown to the user themselves, but everyone else will see a standard\nmessage. The oper reason is shown to operators getting info about the KLINEs 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 KLINE matches the address the person applying it is connected\nfrom. If \"MYSELF\" is not given, trying to KLINE yourself will result in an error.\n\n[duration] can be of the following forms:\n\t1y 12mo 31d 10h 8m 13s\n\n<mask> is specified in typical IRC format. For example:\n\tdan\n\tdan!5*@127.*\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 \"KLINE LIST\" is sent, the server sends back a list of our current KLINEs.",
25
+  "LANGUAGE <code>{ <code>}\n\nSets your preferred languages to the given ones.": "LANGUAGE <code>{ <code>}\n\nSets your preferred languages to the given ones.",
26
+  "LIST [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]\n\nShows information on the given channels (or if none are given, then on all\nchannels). <elistcond>s modify how the channels are selected.": "LIST [<channel>{,<channel>}] [<elistcond>{,<elistcond>}]\n\nShows information on the given channels (or if none are given, then on all\nchannels). <elistcond>s modify how the channels are selected.",
27
+  "LUSERS [<mask> [<server>]]\n\nShows statistics about the size of the network. If <mask> is given, only\nreturns stats for servers matching the given mask.  If <server> is given, the\ncommand is processed by that server.": "LUSERS [<mask> [<server>]]\n\nShows statistics about the size of the network. If <mask> is given, only\nreturns stats for servers matching the given mask.  If <server> is given, the\ncommand is processed by that server.",
28
+  "MODE <target> [<modestring> [<mode arguments>...]]\n\nSets and removes modes from the given target. For more specific information on\nmode characters, see the help for \"modes\".": "MODE <target> [<modestring> [<mode arguments>...]]\n\nSets and removes modes from the given target. For more specific information on\nmode characters, see the help for \"modes\".",
29
+  "MONITOR <subcmd>\n\nAllows the monitoring of nicknames, for alerts when they are online and\noffline. The subcommands are:\n\n    MONITOR + target{,target}\nAdds the given names to your list of monitored nicknames.\n\n    MONITOR - target{,target}\nRemoves the given names from your list of monitored nicknames.\n\n    MONITOR C\nClears your list of monitored nicknames.\n\n    MONITOR L\nLists all the nicknames you are currently monitoring.\n\n    MONITOR S\nLists whether each nick in your MONITOR list is online or offline.": "MONITOR <subcmd>\n\nAllows the monitoring of nicknames, for alerts when they are online and\noffline. The subcommands are:\n\n    MONITOR + target{,target}\nAdds the given names to your list of monitored nicknames.\n\n    MONITOR - target{,target}\nRemoves the given names from your list of monitored nicknames.\n\n    MONITOR C\nClears your list of monitored nicknames.\n\n    MONITOR L\nLists all the nicknames you are currently monitoring.\n\n    MONITOR S\nLists whether each nick in your MONITOR list is online or offline.",
30
+  "MOTD [server]\n\nReturns the message of the day for this, or the given, server.": "MOTD [server]\n\nReturns the message of the day for this, or the given, server.",
31
+  "NAMES [<channel>{,<channel>}]\n\nViews the clients joined to a channel and their channel membership prefixes. To\nview the channel membership prefixes supported by this server, see the help for\n\"PREFIX\".": "NAMES [<channel>{,<channel>}]\n\nViews the clients joined to a channel and their channel membership prefixes. To\nview the channel membership prefixes supported by this server, see the help for\n\"PREFIX\".",
32
+  "NICK <newnick>\n\nSets your nickname to the new given one.": "NICK <newnick>\n\nSets your nickname to the new given one.",
33
+  "NICKSERV <subcommand> [params]\n\nNickServ controls accounts and user registrations.": "NICKSERV <subcommand> [params]\n\nNickServ controls accounts and user registrations.",
34
+  "NOTICE <target>{,<target>} <text to be sent>\n\nSends the text to the given targets as a NOTICE.": "NOTICE <target>{,<target>} <text to be sent>\n\nSends the text to the given targets as a NOTICE.",
35
+  "NPC <target> <sourcenick> <text to be sent>\n\t\t\nThe NPC command is used to send a message to the target as the source.\n\nRequires the roleplay mode (+E) to be set on the target.": "NPC <target> <sourcenick> <text to be sent>\n\t\t\nThe NPC command is used to send a message to the target as the source.\n\nRequires the roleplay mode (+E) to be set on the target.",
36
+  "NPCA <target> <sourcenick> <text to be sent>\n\t\t\nThe NPC command is used to send an action to the target as the source.\n\nRequires the roleplay mode (+E) to be set on the target.": "NPCA <target> <sourcenick> <text to be sent>\n\t\t\nThe NPC command is used to send an action to the target as the source.\n\nRequires the roleplay mode (+E) to be set on the target.",
37
+  "NS <subcommand> [params]\n\nNickServ controls accounts and user registrations.": "NS <subcommand> [params]\n\nNickServ controls accounts and user registrations.",
38
+  "OPER <name> <password>\n\nIf the correct details are given, gives you IRCop privs.": "OPER <name> <password>\n\nIf the correct details are given, gives you IRCop privs.",
39
+  "PART <channel>{,<channel>} [reason]\n\nLeaves the given channels and shows people the given reason.": "PART <channel>{,<channel>} [reason]\n\nLeaves the given channels and shows people the given reason.",
40
+  "PASS <password>\n\nWhen the server requires a connection password to join, used to send us the\npassword.": "PASS <password>\n\nWhen the server requires a connection password to join, used to send us the\npassword.",
41
+  "PING <args>...\n\nRequests a PONG. Used to check link connectivity.": "PING <args>...\n\nRequests a PONG. Used to check link connectivity.",
42
+  "PONG <args>...\n\nReplies to a PING. Used to check link connectivity.": "PONG <args>...\n\nReplies to a PING. Used to check link connectivity.",
43
+  "PRIVMSG <target>{,<target>} <text to be sent>\n\nSends the text to the given targets as a PRIVMSG.": "PRIVMSG <target>{,<target>} <text to be sent>\n\nSends the text to the given targets as a PRIVMSG.",
44
+  "PROXY TCP4/6 <sourceip> <destip> <sourceport> <destport>\n\nUsed by haproxy's PROXY v1 protocol, to allow for alternate TLS support:\nhttp://www.haproxy.org/download/1.8/doc/proxy-protocol.txt": "PROXY TCP4/6 <sourceip> <destip> <sourceport> <destport>\n\nUsed by haproxy's PROXY v1 protocol, to allow for alternate TLS support:\nhttp://www.haproxy.org/download/1.8/doc/proxy-protocol.txt",
45
+  "QUIT [reason]\n\nIndicates that you're leaving the server, and shows everyone the given reason.": "QUIT [reason]\n\nIndicates that you're leaving the server, and shows everyone the given reason.",
46
+  "REHASH\n\nReloads the config file and updates TLS certificates on listeners": "REHASH\n\nReloads the config file and updates TLS certificates on listeners",
47
+  "RENAME <channel> <newname> [<reason>]\n\nRenames the given channel with the given reason, if possible.\n\nFor example:\n\tRENAME #ircv2 #ircv3 :Protocol upgrades!": "RENAME <channel> <newname> [<reason>]\n\nRenames the given channel with the given reason, if possible.\n\nFor example:\n\tRENAME #ircv2 #ircv3 :Protocol upgrades!",
48
+  "RESUME <oldnick> [timestamp]\n\nSent before registration has completed, this indicates that the client wants to\nresume their old connection <oldnick>.": "RESUME <oldnick> [timestamp]\n\nSent before registration has completed, this indicates that the client wants to\nresume their old connection <oldnick>.",
49
+  "RPL_ISUPPORT CASEMAPPING\n\nOragono supports an experimental unicode casemapping designed for extended\nUnicode support. This casemapping is based off RFC 7613 and the draft rfc7613\ncasemapping spec here: https://oragono.io/specs.html": "RPL_ISUPPORT CASEMAPPING\n\nOragono supports an experimental unicode casemapping designed for extended\nUnicode support. This casemapping is based off RFC 7613 and the draft rfc7613\ncasemapping spec here: https://oragono.io/specs.html",
50
+  "RPL_ISUPPORT PREFIX\n\nOragono supports the following channel membership prefixes:\n\n  +q (~)  |  Founder channel mode.\n  +a (&)  |  Admin channel mode.\n  +o (@)  |  Operator channel mode.\n  +h (%)  |  Halfop channel mode.\n  +v (+)  |  Voice channel mode.": "RPL_ISUPPORT PREFIX\n\nOragono supports the following channel membership prefixes:\n\n  +q (~)  |  Founder channel mode.\n  +a (&)  |  Admin channel mode.\n  +o (@)  |  Operator channel mode.\n  +h (%)  |  Halfop channel mode.\n  +v (+)  |  Voice channel mode.",
51
+  "SAMODE <target> [<modestring> [<mode arguments>...]]\n\nForcibly sets and removes modes from the given target -- only available to\nopers. For more specific information on mode characters, see the help for\n\"cmode\" and \"umode\".": "SAMODE <target> [<modestring> [<mode arguments>...]]\n\nForcibly sets and removes modes from the given target -- only available to\nopers. For more specific information on mode characters, see the help for\n\"cmode\" and \"umode\".",
52
+  "SANICK <currentnick> <newnick>\n\nGives the given user a new nickname.": "SANICK <currentnick> <newnick>\n\nGives the given user a new nickname.",
53
+  "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.",
54
+  "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.",
55
+  "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.",
56
+  "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",
57
+  "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.*",
58
+  "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).",
59
+  "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.",
60
+  "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.",
61
+  "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",
62
+  "WHO <name> [o]\n\nReturns information for the given user.": "WHO <name> [o]\n\nReturns information for the given user.",
63
+  "WHOIS <client>{,<client>}\n\nReturns information for the given user(s).": "WHOIS <client>{,<client>}\n\nReturns information for the given user(s).",
64
+  "WHOWAS <nickname>\n\nReturns historical information on the last user with the given nickname.": "WHOWAS <nickname>\n\nReturns historical information on the last user with the given nickname."
65
+}

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

@@ -0,0 +1,145 @@
1
+{
2
+  "%d IRC Operators online": "%d IRC Operators online",
3
+  "%d channels formed": "%d channels formed",
4
+  "*** Could not find your username": "*** Could not find your username",
5
+  "*** Found your username": "*** Found your username",
6
+  "*** Got a malformed username, ignoring": "*** Got a malformed username, ignoring",
7
+  "*** Looking up your username": "*** Looking up your username",
8
+  "- %s Message of the day - ": "- %s Message of the day - ",
9
+  "Account already exists": "Account already exists",
10
+  "Account created": "Account created",
11
+  "Account name is not valid": "Account name is not valid",
12
+  "Account registration is disabled": "Account registration is disabled",
13
+  "Actual user@host, Actual IP": "Actual user@host, Actual IP",
14
+  "Added D-Line for %s": "Added D-Line for %s",
15
+  "Added K-Line for %s": "Added K-Line for %s",
16
+  "Added temporary (%s) D-Line for %s": "Added temporary (%s) D-Line for %s",
17
+  "Added temporary (%s) K-Line for %s": "Added temporary (%s) K-Line for %s",
18
+  "Authentication successful": "Authentication successful",
19
+  "Ban - %s - added by %s - %s": "Ban - %s - added by %s - %s",
20
+  "Callback namespace is not supported": "Callback namespace is not supported",
21
+  "Can't change modes for other users": "Can't change modes for other users",
22
+  "Can't view modes for other users": "Can't view modes for other users",
23
+  "Cannot join channel (+%s)": "Cannot join channel (+%s)",
24
+  "Cannot resume connection, connection registration has already been completed": "Cannot resume connection, connection registration has already been completed",
25
+  "Cannot resume connection, old and new clients must be logged into the same account": "Cannot resume connection, old and new clients must be logged into the same account",
26
+  "Cannot resume connection, old and new clients must have TLS": "Cannot resume connection, old and new clients must have TLS",
27
+  "Cannot resume connection, old client not found": "Cannot resume connection, old client not found",
28
+  "Cannot resume connection, old nickname contains spaces": "Cannot resume connection, old nickname contains spaces",
29
+  "Cannot send to channel": "Cannot send to channel",
30
+  "Channel %s successfully registered": "Channel %s successfully registered",
31
+  "Channel doesn't have roleplaying mode available": "Channel doesn't have roleplaying mode available",
32
+  "Channel list is full": "Channel list is full",
33
+  "Channel name is not valid": "Channel name is not valid",
34
+  "Channel registration is not enabled": "Channel registration is not enabled",
35
+  "Channel renamed: %s": "Channel renamed: %s",
36
+  "Client reconnected": "Client reconnected",
37
+  "Contributors and Former Developers:": "Contributors and Former Developers:",
38
+  "Core Developers:": "Core Developers:",
39
+  "Could not apply mode changes: +%s": "Could not apply mode changes: +%s",
40
+  "Could not parse IP address or CIDR network": "Could not parse IP address or CIDR network",
41
+  "Could not register": "Could not register",
42
+  "Could not remove ban [%s]": "Could not remove ban [%s]",
43
+  "Could not set or change nickname: %s": "Could not set or change nickname: %s",
44
+  "Could not successfully save new D-LINE: %s": "Could not successfully save new D-LINE: %s",
45
+  "Could not successfully save new K-LINE: %s": "Could not successfully save new K-LINE: %s",
46
+  "Credential type is not supported": "Credential type is not supported",
47
+  "End of /HELPOP": "End of /HELPOP",
48
+  "End of /WHOIS list": "End of /WHOIS list",
49
+  "End of LIST": "End of LIST",
50
+  "End of MOTD command": "End of MOTD command",
51
+  "End of NAMES list": "End of NAMES list",
52
+  "End of WHO list": "End of WHO list",
53
+  "End of WHOWAS": "End of WHOWAS",
54
+  "End of list": "End of list",
55
+  "Erroneous nickname": "Erroneous nickname",
56
+  "Fake source must be a valid nickname": "Fake source must be a valid nickname",
57
+  "First param must be a mask or channel": "First param must be a mask or channel",
58
+  "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.",
59
+  "Help not found": "Help not found",
60
+  "I have %d clients and %d servers": "I have %d clients and %d servers",
61
+  "Insufficient oper privs": "Insufficient oper privs",
62
+  "Invalid CAP subcommand": "Invalid CAP subcommand",
63
+  "JOIN 0 is not allowed": "JOIN 0 is not allowed",
64
+  "Language preferences have been set": "Language preferences have been set",
65
+  "Languages are not supported by this server": "Languages are not supported by this server",
66
+  "MOTD File is missing": "MOTD File is missing",
67
+  "Malformed username": "Malformed username",
68
+  "Mask isn't valid": "Mask isn't valid",
69
+  "NickServ is not yet implemented, sorry! To register an account, check /HELPOP REG": "NickServ is not yet implemented, sorry! To register an account, check /HELPOP REG",
70
+  "Nickname is already in use": "Nickname is already in use",
71
+  "No DLINEs have been set!": "No DLINEs have been set!",
72
+  "No command given": "No command given",
73
+  "No masks given": "No masks given",
74
+  "No nickname given": "No nickname given",
75
+  "No such channel": "No such channel",
76
+  "No such nick": "No such nick",
77
+  "No such server": "No such server",
78
+  "No topic is set": "No topic is set",
79
+  "Not enough parameters": "Not enough parameters",
80
+  "Only channel founders can change registered channels": "Only channel founders can change registered channels",
81
+  "Oragono is released under the MIT license.": "Oragono is released under the MIT license.",
82
+  "PROXY command is not usable from your address": "PROXY command is not usable from your address",
83
+  "Password incorrect": "Password incorrect",
84
+  "Permission Denied": "Permission Denied",
85
+  "Permission Denied - You're not an IRC operator": "Permission Denied - You're not an IRC operator",
86
+  "Proxied IP address is not valid: [%s]": "Proxied IP address is not valid: [%s]",
87
+  "Received malformed line": "Received malformed line",
88
+  "Rehashing": "Rehashing",
89
+  "Remote servers not yet supported": "Remote servers not yet supported",
90
+  "Removed D-Line for %s": "Removed D-Line for %s",
91
+  "Removed K-Line for %s": "Removed K-Line for %s",
92
+  "SASL authentication aborted": "SASL authentication aborted",
93
+  "SASL authentication failed": "SASL authentication failed",
94
+  "SASL authentication failed, you are not connecting with a certificate": "SASL authentication failed, you are not connecting with a certificate",
95
+  "SASL authentication failed: Bad account name": "SASL authentication failed: Bad account name",
96
+  "SASL authentication failed: Invalid auth blob": "SASL authentication failed: Invalid auth blob",
97
+  "SASL authentication failed: Invalid b64 encoding": "SASL authentication failed: Invalid b64 encoding",
98
+  "SASL authentication failed: Passphrase too long": "SASL authentication failed: Passphrase too long",
99
+  "SASL authentication failed: authcid and authzid should be the same": "SASL authentication failed: authcid and authzid should be the same",
100
+  "SASL authentication successful": "SASL authentication successful",
101
+  "SASL message too long": "SASL message too long",
102
+  "Server notice masks": "Server notice masks",
103
+  "Sorry, I don't know that command": "Sorry, I don't know that command",
104
+  "Syntax: REGISTER <channel>": "Syntax: REGISTER <channel>",
105
+  "Thanks to Jeremy Latt for founding Ergonomadic, the project this is based on <3": "Thanks to Jeremy Latt for founding Ergonomadic, the project this is based on <3",
106
+  "There are %d users and %d invisible on %d server(s)": "There are %d users and %d invisible on %d server(s)",
107
+  "There was no such nickname": "There was no such nickname",
108
+  "They aren't on that channel": "They aren't on that channel",
109
+  "This ban matches you. To DLINE yourself, you must use the command:  /DLINE MYSELF <arguments>": "This ban matches you. To DLINE yourself, you must use the command:  /DLINE MYSELF <arguments>",
110
+  "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>",
111
+  "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.",
112
+  "This server was created %s": "This server was created %s",
113
+  "Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it": "Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it",
114
+  "Unknown command": "Unknown command",
115
+  "Unknown subcommand": "Unknown subcommand",
116
+  "User doesn't have roleplaying mode enabled": "User doesn't have roleplaying mode enabled",
117
+  "VERIFY is not yet implemented": "VERIFY is not yet implemented",
118
+  "WEBIRC command is not usable from your address or incorrect password given": "WEBIRC command is not usable from your address or incorrect password given",
119
+  "Welcome to the Internet Relay Network %s": "Welcome to the Internet Relay Network %s",
120
+  "You are banned from this server (%s)": "You are banned from this server (%s)",
121
+  "You are no longer marked as being away": "You are no longer marked as being away",
122
+  "You are not using a TLS certificate": "You are not using a TLS certificate",
123
+  "You are now an IRC operator": "You are now an IRC operator",
124
+  "You are now logged in as %s": "You are now logged in as %s",
125
+  "You have been banned from this server (%s)": "You have been banned from this server (%s)",
126
+  "You have been marked as being away": "You have been marked as being away",
127
+  "You may not reregister": "You may not reregister",
128
+  "You must be an oper on the channel to register it": "You must be an oper on the channel to register it",
129
+  "You must be logged in to register a channel": "You must be logged in to register a channel",
130
+  "You need to register before you can use that command": "You need to register before you can use that command",
131
+  "You need to run a command": "You need to run a command",
132
+  "You specified too many languages": "You specified too many languages",
133
+  "You're already logged into an account": "You're already logged into an account",
134
+  "You're already opered-up!": "You're already opered-up!",
135
+  "You're not a channel operator": "You're not a channel operator",
136
+  "You're not on that channel": "You're not on that channel",
137
+  "Your host is %s, running version %s": "Your host is %s, running version %s",
138
+  "can speak these languages": "can speak these languages",
139
+  "has client certificate fingerprint %s": "has client certificate fingerprint %s",
140
+  "is a $bBot$b on %s": "is a $bBot$b on %s",
141
+  "is an unknown mode character to me": "is an unknown mode character to me",
142
+  "is logged in as": "is logged in as",
143
+  "is using a secure connection": "is using a secure connection",
144
+  "seconds idle, signon time": "seconds idle, signon time"
145
+}

+ 8
- 145
languages/example.lang.yaml View File

@@ -1,5 +1,11 @@
1
-# language file for our example language
2
-# if you're creating a new language file, base it off this one (this one contains all the strings you can replace)
1
+# language info file for our example language
2
+#
3
+# languages are made up of a few different files:
4
+#    <locale>.lang.yaml       - general info about the translation
5
+#    <locale>-irc.lang.json   - IRC strings to be translated
6
+#    <locale>-help.lang.json  - help entries to be translated
7
+#
8
+# we split up translations in this way so that they can be displayed more nicely on CrowdIn
3 9
 
4 10
 # name - this is the 'nice' or 'full' name of the language
5 11
 name: "Example"
@@ -12,146 +18,3 @@ maintainers: "Daniel Oaks <daniel@danieloaks.net>"
12 18
 
13 19
 # incomplete - whether to mark this language as incomplete
14 20
 incomplete: true
15
-
16
-# translations - this holds the actual replacements
17
-# make sure this is the last part of the file, and that the below string, "translations:",
18
-# stays as-is. the language-update processor uses the next line to designate which part of
19
-# the file to ignore and which part to actually process.
20
-translations:
21
-  "%d IRC Operators online": ""
22
-  "%d channels formed": ""
23
-  "*** Could not find your username": ""
24
-  "*** Found your username": ""
25
-  "*** Got a malformed username, ignoring": ""
26
-  "*** Looking up your username": ""
27
-  "- %s Message of the day - ": ""
28
-  "Account already exists": ""
29
-  "Account created": ""
30
-  "Account name is not valid": ""
31
-  "Account registration is disabled": ""
32
-  "Actual user@host, Actual IP": ""
33
-  "Added K-Line for %s": ""
34
-  "Added temporary (%s) K-Line for %s": ""
35
-  "Authentication successful": ""
36
-  "Ban - %s - added by %s - %s": ""
37
-  "Callback namespace is not supported": ""
38
-  "Can't change modes for other users": ""
39
-  "Can't view modes for other users": ""
40
-  "Cannot join channel (+%s)": ""
41
-  "Cannot resume connection, connection registration has already been completed": ""
42
-  "Cannot resume connection, old and new clients must be logged into the same account": ""
43
-  "Cannot resume connection, old and new clients must have TLS": ""
44
-  "Cannot resume connection, old client not found": ""
45
-  "Cannot resume connection, old nickname contains spaces": ""
46
-  "Cannot send to channel": ""
47
-  "Channel %s successfully registered": ""
48
-  "Channel doesn't have roleplaying mode available": ""
49
-  "Channel list is full": ""
50
-  "Channel name is not valid": ""
51
-  "Channel registration is not enabled": ""
52
-  "Channel renamed: %s": ""
53
-  "Client reconnected": ""
54
-  "Could not apply mode changes: +%s": ""
55
-  "Could not parse IP address or CIDR network": ""
56
-  "Could not register": ""
57
-  "Could not remove ban [%s]": ""
58
-  "Could not set or change nickname: %s": ""
59
-  "Could not successfully save new D-LINE: %s": ""
60
-  "Could not successfully save new K-LINE: %s": ""
61
-  "Credential type is not supported": ""
62
-  "End of /HELPOP": ""
63
-  "End of /WHOIS list": ""
64
-  "End of LIST": ""
65
-  "End of MOTD command": ""
66
-  "End of NAMES list": ""
67
-  "End of WHO list": ""
68
-  "End of WHOWAS": ""
69
-  "End of list": ""
70
-  "Erroneous nickname": ""
71
-  "Fake source must be a valid nickname": ""
72
-  "First param must be a mask or channel": ""
73
-  "HELPOP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.": ""
74
-  "Help not found": ""
75
-  "I have %d clients and %d servers": ""
76
-  "Insufficient oper privs": ""
77
-  "Invalid CAP subcommand": ""
78
-  "JOIN 0 is not allowed": ""
79
-  "Language preferences have been set": ""
80
-  "Languages are not supported by this server": ""
81
-  "MOTD File is missing": ""
82
-  "Malformed username": ""
83
-  "Mask isn't valid": ""
84
-  "NickServ is not yet implemented, sorry! To register an account, check /HELPOP REG": ""
85
-  "Nickname is already in use": ""
86
-  "No DLINEs have been set!": ""
87
-  "No command given": ""
88
-  "No masks given": ""
89
-  "No nickname given": ""
90
-  "No such channel": ""
91
-  "No such nick": ""
92
-  "No such server": ""
93
-  "No topic is set": ""
94
-  "Not enough parameters": ""
95
-  "Only channel founders can change registered channels": ""
96
-  "PROXY command is not usable from your address": ""
97
-  "Password incorrect": ""
98
-  "Permission Denied": ""
99
-  "Permission Denied - You're not an IRC operator": ""
100
-  "Proxied IP address is not valid: [%s]": ""
101
-  "Received malformed line": ""
102
-  "Rehashing": ""
103
-  "Remote servers not yet supported": ""
104
-  "Removed D-Line for %s": ""
105
-  "Removed K-Line for %s": ""
106
-  "SASL authentication aborted": ""
107
-  "SASL authentication failed": ""
108
-  "SASL authentication failed, you are not connecting with a certificate": ""
109
-  "SASL authentication failed: Bad account name": ""
110
-  "SASL authentication failed: Invalid auth blob": ""
111
-  "SASL authentication failed: Invalid b64 encoding": ""
112
-  "SASL authentication failed: Passphrase too long": ""
113
-  "SASL authentication failed: authcid and authzid should be the same": ""
114
-  "SASL authentication successful": ""
115
-  "SASL message too long": ""
116
-  "Server notice masks": ""
117
-  "Sorry, I don't know that command": ""
118
-  "Syntax: REGISTER <channel>": ""
119
-  "There are %d users and %d invisible on %d server(s)": ""
120
-  "There was no such nickname": ""
121
-  "They aren't on that channel": ""
122
-  "This ban matches you. To DLINE yourself, you must use the command:  /DLINE MYSELF <arguments>": ""
123
-  "This ban matches you. To KLINE yourself, you must use the command:  /KLINE MYSELF <arguments>": ""
124
-  "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.": ""
125
-  "This server was created %s": ""
126
-  "Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it": ""
127
-  "Unknown command": ""
128
-  "Unknown subcommand": ""
129
-  "User doesn't have roleplaying mode enabled": ""
130
-  "VERIFY is not yet implemented": ""
131
-  "WEBIRC command is not usable from your address or incorrect password given": ""
132
-  "Welcome to the Internet Relay Network %s": ""
133
-  "You are banned from this server (%s)": ""
134
-  "You are no longer marked as being away": ""
135
-  "You are not using a TLS certificate": ""
136
-  "You are now an IRC operator": ""
137
-  "You are now logged in as %s": ""
138
-  "You have been banned from this server (%s)": ""
139
-  "You have been marked as being away": ""
140
-  "You may not reregister": ""
141
-  "You must be an oper on the channel to register it": ""
142
-  "You must be logged in to register a channel": ""
143
-  "You need to register before you can use that command": ""
144
-  "You need to run a command": ""
145
-  "You specified too many languages": ""
146
-  "You're already logged into an account": ""
147
-  "You're already opered-up!": ""
148
-  "You're not a channel operator": ""
149
-  "You're not on that channel": ""
150
-  "Your host is %s, running version %s": ""
151
-  "can speak these languages": ""
152
-  "has client certificate fingerprint %s": ""
153
-  "is a $bBot$b on %s": ""
154
-  "is an unknown mode character to me": ""
155
-  "is logged in as": ""
156
-  "is using a secure connection": ""
157
-  "seconds idle, signon time": ""

+ 28
- 8
updatetranslations.py View File

@@ -26,6 +26,7 @@ Options:
26 26
     <languages-dir>  Languages directory."""
27 27
 import os
28 28
 import re
29
+import json
29 30
 
30 31
 from docopt import docopt
31 32
 import yaml
@@ -34,7 +35,8 @@ if __name__ == '__main__':
34 35
     arguments = docopt(__doc__, version="0.1.0")
35 36
 
36 37
     if arguments['run']:
37
-        lang_strings = []
38
+        # general IRC strings
39
+        irc_strings = []
38 40
 
39 41
         for subdir, dirs, files in os.walk(arguments['<irc-dir>']):
40 42
             for fname in files:
@@ -44,14 +46,32 @@ if __name__ == '__main__':
44 46
 
45 47
                     matches = re.findall(r'\.t\("((?:[^"]|\\")+)"\)', content)
46 48
                     for match in matches:
47
-                        if match not in lang_strings:
48
-                            lang_strings.append(match)
49
+                        if match not in irc_strings:
50
+                            irc_strings.append(match)
49 51
 
50 52
                     matches = re.findall(r'\.t\(\`([^\`]+)\`\)', content)
51 53
                     for match in matches:
52
-                        match = match.replace("\n", "\\n").replace("\"", "\\\"")
53
-                        if match not in lang_strings:
54
-                            lang_strings.append(match)
54
+                        if match not in irc_strings:
55
+                            irc_strings.append(match)
55 56
 
56
-        for match in sorted(lang_strings):
57
-            print('  "' + match + '": ""')
57
+        print("irc strings:")
58
+        print(json.dumps({k:k for k in irc_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
59
+
60
+        # help entries
61
+        help_strings = []
62
+
63
+        for subdir, dirs, files in os.walk(arguments['<irc-dir>']):
64
+            for fname in files:
65
+                filepath = subdir + os.sep + fname
66
+                if fname == 'help.go':
67
+                    content = open(filepath, 'r').read()
68
+
69
+                    matches = re.findall(r'\`([^\`]+)\`', content)
70
+                    for match in matches:
71
+                        if '\n' in match and match not in help_strings:
72
+                            help_strings.append(match)
73
+
74
+        print()
75
+
76
+        print("help strings:")
77
+        print(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))

Loading…
Cancel
Save