Very initial beginning of languages implementation

This commit is contained in:
Daniel Oaks 2018-01-21 16:11:16 +10:00
parent cf53d27615
commit ba77a95c81
4 changed files with 26 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -167,6 +167,11 @@ type Config struct {
ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"`
}
Languages struct {
Enabled bool
Path string
}
Datastore struct {
Path string
}

View File

@ -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 <daniel@danieloaks.net>"
# 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:
"": ""