diff --git a/irc/config.go b/irc/config.go index 55132ffc..0739eac8 100644 --- a/irc/config.go +++ b/irc/config.go @@ -149,7 +149,7 @@ type StackImpactConfig struct { type LangData struct { Name string Code string - Maintainers string + Contributors string Incomplete bool Translations map[string]string } @@ -571,8 +571,8 @@ func LoadConfig(filename string) (config *Config, err error) { return nil, fmt.Errorf("Cannot have language file with code 'en' (this is the default language using strings inside the server code). If you're making an English variant, name it with a more specific code") } - if langInfo.Code == "" || langInfo.Name == "" || langInfo.Maintainers == "" { - return nil, fmt.Errorf("Code, name or maintainers is empty in language file [%s]", name) + if langInfo.Code == "" || langInfo.Name == "" || langInfo.Contributors == "" { + return nil, fmt.Errorf("Code, name or contributors is empty in language file [%s]", name) } if len(langInfo.Translations) == 0 { diff --git a/irc/dline.go b/irc/dline.go index a39cc313..09329a02 100644 --- a/irc/dline.go +++ b/irc/dline.go @@ -236,7 +236,7 @@ func dlineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { } for key, info := range bans { - client.Notice(fmt.Sprintf(client.t("Ban - %s - added by %s - %s"), key, info.OperName, info.BanMessage("%s"))) + client.Notice(fmt.Sprintf(client.t("Ban - %[1]s - added by %[2]s - %[3]s"), key, info.OperName, info.BanMessage("%s"))) } return false @@ -372,7 +372,7 @@ func dlineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { var snoDescription string if durationIsUsed { - client.Notice(fmt.Sprintf(client.t("Added temporary (%s) D-Line for %s"), duration.String(), hostString)) + client.Notice(fmt.Sprintf(client.t("Added temporary (%[1]s) D-Line for %[2]s"), duration.String(), hostString)) snoDescription = fmt.Sprintf(ircfmt.Unescape("%s [%s]$r added temporary (%s) D-Line for %s"), client.nick, operName, duration.String(), hostString) } else { client.Notice(fmt.Sprintf(client.t("Added D-Line for %s"), hostString)) diff --git a/irc/kline.go b/irc/kline.go index 638a052e..8c319e54 100644 --- a/irc/kline.go +++ b/irc/kline.go @@ -269,7 +269,7 @@ func klineHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { var snoDescription string if durationIsUsed { - client.Notice(fmt.Sprintf(client.t("Added temporary (%s) K-Line for %s"), duration.String(), mask)) + client.Notice(fmt.Sprintf(client.t("Added temporary (%[1]s) K-Line for %[2]s"), duration.String(), mask)) snoDescription = fmt.Sprintf(ircfmt.Unescape("%s [%s]$r added temporary (%s) K-Line for %s"), client.nick, operName, duration.String(), mask) } else { client.Notice(fmt.Sprintf(client.t("Added K-Line for %s"), mask)) diff --git a/irc/languages.go b/irc/languages.go index a3bc736d..5a39eaea 100644 --- a/irc/languages.go +++ b/irc/languages.go @@ -26,9 +26,9 @@ func NewLanguageManager(defaultLang string, languageData map[string]LangData) *L // make fake "en" info lm.Info["en"] = LangData{ - Code: "en", - Name: "English", - Maintainers: "Oragono contributors and the IRC community", + Code: "en", + Name: "English", + Contributors: "Oragono contributors and the IRC community", } // load language data diff --git a/irc/server.go b/irc/server.go index fce040a7..e34c8fb4 100644 --- a/irc/server.go +++ b/irc/server.go @@ -428,7 +428,7 @@ func (server *Server) tryRegister(c *Client) { //NOTE(dan): we specifically use the NICK here instead of the nickmask // see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask c.Send(nil, server.name, RPL_WELCOME, c.nick, fmt.Sprintf(c.t("Welcome to the Internet Relay Network %s"), c.nick)) - c.Send(nil, server.name, RPL_YOURHOST, c.nick, fmt.Sprintf(c.t("Your host is %s, running version %s"), server.name, Ver)) + c.Send(nil, server.name, RPL_YOURHOST, c.nick, fmt.Sprintf(c.t("Your host is %[1]s, running version %[2]s"), server.name, Ver)) c.Send(nil, server.name, RPL_CREATED, c.nick, fmt.Sprintf(c.t("This server was created %s"), server.ctime.Format(time.RFC1123))) //TODO(dan): Look at adding last optional [] parameter c.Send(nil, server.name, RPL_MYINFO, c.nick, server.name, Ver, supportedUserModesString, supportedChannelModesString) @@ -2094,10 +2094,10 @@ func lusersHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { opercount++ } } - client.Send(nil, server.name, RPL_LUSERCLIENT, client.nick, fmt.Sprintf(client.t("There are %d users and %d invisible on %d server(s)"), totalcount, invisiblecount, 1)) + client.Send(nil, server.name, RPL_LUSERCLIENT, client.nick, fmt.Sprintf(client.t("There are %[1]d users and %[2]d invisible on %[3]d server(s)"), totalcount, invisiblecount, 1)) client.Send(nil, server.name, RPL_LUSEROP, client.nick, fmt.Sprintf(client.t("%d IRC Operators online"), opercount)) client.Send(nil, server.name, RPL_LUSERCHANNELS, client.nick, fmt.Sprintf(client.t("%d channels formed"), server.channels.Len())) - client.Send(nil, server.name, RPL_LUSERME, client.nick, fmt.Sprintf(client.t("I have %d clients and %d servers"), totalcount, 1)) + client.Send(nil, server.name, RPL_LUSERME, client.nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), totalcount, 1)) return false } diff --git a/languages/example-irc.lang.json b/languages/example-irc.lang.json index 7ed70ff0..fb47cce7 100644 --- a/languages/example-irc.lang.json +++ b/languages/example-irc.lang.json @@ -13,9 +13,10 @@ "Actual user@host, Actual IP": "Actual user@host, Actual IP", "Added D-Line for %s": "Added D-Line for %s", "Added K-Line for %s": "Added K-Line for %s", - "Added temporary (%s) D-Line for %s": "Added temporary (%s) D-Line for %s", - "Added temporary (%s) K-Line for %s": "Added temporary (%s) K-Line for %s", + "Added temporary (%[1]s) D-Line for %[2]s": "Added temporary (%[1]s) D-Line for %[2]s", + "Added temporary (%[1]s) K-Line for %[2]s": "Added temporary (%[1]s) K-Line for %[2]s", "Authentication successful": "Authentication successful", + "Ban - %[1]s - added by %[2]s - %[3]s": "Ban - %[1]s - added by %[2]s - %[3]s", "Ban - %s - added by %s - %s": "Ban - %s - added by %s - %s", "Callback namespace is not supported": "Callback namespace is not supported", "Can't change modes for other users": "Can't change modes for other users", @@ -57,7 +58,7 @@ "First param must be a mask or channel": "First param must be a mask or channel", "HELPOP \n\nGet an explanation of , or \"index\" for a list of help topics.": "HELPOP \n\nGet an explanation of , or \"index\" for a list of help topics.", "Help not found": "Help not found", - "I have %d clients and %d servers": "I have %d clients and %d servers", + "I have %[1]d clients and %[2]d servers": "I have %[1]d clients and %[2]d servers", "Insufficient oper privs": "Insufficient oper privs", "Invalid CAP subcommand": "Invalid CAP subcommand", "JOIN 0 is not allowed": "JOIN 0 is not allowed", @@ -103,7 +104,7 @@ "Sorry, I don't know that command": "Sorry, I don't know that command", "Syntax: REGISTER ": "Syntax: REGISTER ", "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", - "There are %d users and %d invisible on %d server(s)": "There are %d users and %d invisible on %d server(s)", + "There are %[1]d users and %[2]d invisible on %[3]d server(s)": "There are %[1]d users and %[2]d invisible on %[3]d server(s)", "There was no such nickname": "There was no such nickname", "They aren't on that channel": "They aren't on that channel", "This ban matches you. To DLINE yourself, you must use the command: /DLINE MYSELF ": "This ban matches you. To DLINE yourself, you must use the command: /DLINE MYSELF ", @@ -134,7 +135,7 @@ "You're already opered-up!": "You're already opered-up!", "You're not a channel operator": "You're not a channel operator", "You're not on that channel": "You're not on that channel", - "Your host is %s, running version %s": "Your host is %s, running version %s", + "Your host is %[1]s, running version %[2]s": "Your host is %[1]s, running version %[2]s", "can speak these languages": "can speak these languages", "has client certificate fingerprint %s": "has client certificate fingerprint %s", "is a $bBot$b on %s": "is a $bBot$b on %s", @@ -142,4 +143,4 @@ "is logged in as": "is logged in as", "is using a secure connection": "is using a secure connection", "seconds idle, signon time": "seconds idle, signon time" -} \ No newline at end of file +} diff --git a/languages/example.lang.yaml b/languages/example.lang.yaml index 2c35ea61..adab11ca 100644 --- a/languages/example.lang.yaml +++ b/languages/example.lang.yaml @@ -1,4 +1,4 @@ -# language info file for our example language +# translation info file for our example language # # languages are made up of a few different files: # .lang.yaml - general info about the translation @@ -8,13 +8,13 @@ # we split up translations in this way so that they can be displayed more nicely on CrowdIn # name - this is the 'nice' or 'full' name of the language -name: "Example" +name: "English" # code - this is what the language will be referred to in our list of languages -code: "example" +code: "en" -# maintainers - these are the maintainer details given -maintainers: "Daniel Oaks " +# contributors - people who have contributed to this translation +contributors: "Example Person " # incomplete - whether to mark this language as incomplete incomplete: true