From ba77a95c81b55c85145a0786f9b66a7824b02536 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 21 Jan 2018 16:11:16 +1000 Subject: [PATCH] Very initial beginning of languages implementation --- irc/capability.go | 2 +- irc/caps/constants.go | 2 ++ irc/config.go | 5 +++++ languages/example.lang.yaml | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 languages/example.lang.yaml diff --git a/irc/capability.go b/irc/capability.go index 6622a412..3be59e88 100644 --- a/irc/capability.go +++ b/irc/capability.go @@ -14,7 +14,7 @@ import ( var ( // SupportedCapabilities are the caps we advertise. // MaxLine, SASL and STS are set during server startup. - SupportedCapabilities = caps.NewSet(caps.AccountTag, caps.AccountNotify, caps.AwayNotify, caps.CapNotify, caps.ChgHost, caps.EchoMessage, caps.ExtendedJoin, caps.InviteNotify, caps.MessageTags, caps.MultiPrefix, caps.Rename, caps.ServerTime, caps.UserhostInNames) + SupportedCapabilities = caps.NewSet(caps.AccountTag, caps.AccountNotify, caps.AwayNotify, caps.CapNotify, caps.ChgHost, caps.EchoMessage, caps.ExtendedJoin, caps.InviteNotify, caps.Languages, caps.MessageTags, caps.MultiPrefix, caps.Rename, caps.ServerTime, caps.UserhostInNames) // CapValues are the actual values we advertise to v3.2 clients. // actual values are set during server startup. diff --git a/irc/caps/constants.go b/irc/caps/constants.go index 9287fc24..d2e73e25 100644 --- a/irc/caps/constants.go +++ b/irc/caps/constants.go @@ -27,6 +27,8 @@ const ( InviteNotify Capability = "invite-notify" // LabeledResponse is this draft IRCv3 capability: http://ircv3.net/specs/extensions/labeled-response.html LabeledResponse Capability = "draft/labeled-response" + // Languages is this proposed IRCv3 capability: https://gist.github.com/DanielOaks/8126122f74b26012a3de37db80e4e0c6 + Languages Capability = "draft/languages" // MaxLine is this capability: https://oragono.io/maxline MaxLine Capability = "oragono.io/maxline" // MessageTags is this draft IRCv3 capability: http://ircv3.net/specs/core/message-tags-3.3.html diff --git a/irc/config.go b/irc/config.go index f1242d72..d4c2cfde 100644 --- a/irc/config.go +++ b/irc/config.go @@ -167,6 +167,11 @@ type Config struct { ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"` } + Languages struct { + Enabled bool + Path string + } + Datastore struct { Path string } diff --git a/languages/example.lang.yaml b/languages/example.lang.yaml new file mode 100644 index 00000000..c0144a50 --- /dev/null +++ b/languages/example.lang.yaml @@ -0,0 +1,18 @@ +# language file for our example language +# if you're creating a new language file, base it off this one (this one contains all the strings you can replace) + +# name - this is the 'nice' or 'full' name of the language +name: "Example" + +# code - this is what the language will be referred to in our list of languages +code: "example" + +# maintainers - these are the maintainer details given +maintainers: "Daniel Oaks " + +# strings - this holds the actual replacements +# make sure this is the last part of the file, and that the below string, "strings:", stays as-is +# the language-update processor uses the next line to designate which part of the file to ignore and +# which part to actually process. +strings: + "": ""