mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 11:59:40 +01:00
Don't load example translation file, make example actually list all translatable strings
This commit is contained in:
parent
090095b2b9
commit
b2afd55285
@ -501,6 +501,10 @@ func LoadConfig(filename string) (config *Config, err error) {
|
||||
if !strings.HasSuffix(strings.ToLower(name), ".lang.yaml") {
|
||||
continue
|
||||
}
|
||||
// don't load our example file in practice
|
||||
if strings.ToLower(name) == "example.lang.yaml" {
|
||||
continue
|
||||
}
|
||||
|
||||
data, err = ioutil.ReadFile(filepath.Join(config.Languages.Path, name))
|
||||
if err != nil {
|
||||
|
@ -18,5 +18,140 @@ incomplete: true
|
||||
# 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.
|
||||
translations:
|
||||
"Welcome to the Internet Relay Network %s": "Welcome braaaah to the IRN broski %s"
|
||||
"Language preferences have been set": "You've set your languages man, wicked!"
|
||||
"%d IRC Operators online": ""
|
||||
"%d channels formed": ""
|
||||
"*** Could not find your username": ""
|
||||
"*** Found your username": ""
|
||||
"*** Got a malformed username, ignoring": ""
|
||||
"*** Looking up your username": ""
|
||||
"- %s Message of the day - ": ""
|
||||
"Account already exists": ""
|
||||
"Account created": ""
|
||||
"Account name is not valid": ""
|
||||
"Account registration is disabled": ""
|
||||
"Actual user@host, Actual IP": ""
|
||||
"Added K-Line for %s": ""
|
||||
"Added temporary (%s) K-Line for %s": ""
|
||||
"Authentication successful": ""
|
||||
"Ban - %s - added by %s - %s": ""
|
||||
"Callback namespace is not supported": ""
|
||||
"Can't change modes for other users": ""
|
||||
"Can't view modes for other users": ""
|
||||
"Cannot join channel (+%s)": ""
|
||||
"Cannot resume connection, connection registration has already been completed": ""
|
||||
"Cannot resume connection, old and new clients must be logged into the same account": ""
|
||||
"Cannot resume connection, old and new clients must have TLS": ""
|
||||
"Cannot resume connection, old client not found": ""
|
||||
"Cannot resume connection, old nickname contains spaces": ""
|
||||
"Cannot send to channel": ""
|
||||
"Channel %s successfully registered": ""
|
||||
"Channel doesn't have roleplaying mode available": ""
|
||||
"Channel list is full": ""
|
||||
"Channel name is not valid": ""
|
||||
"Channel registration is not enabled": ""
|
||||
"Channel renamed: %s": ""
|
||||
"Client reconnected": ""
|
||||
"Could not apply mode changes: +%s": ""
|
||||
"Could not parse IP address or CIDR network": ""
|
||||
"Could not register": ""
|
||||
"Could not remove ban [%s]": ""
|
||||
"Could not set or change nickname: %s": ""
|
||||
"Could not successfully save new D-LINE: %s": ""
|
||||
"Could not successfully save new K-LINE: %s": ""
|
||||
"Credential type is not supported": ""
|
||||
"End of /HELPOP": ""
|
||||
"End of /WHOIS list": ""
|
||||
"End of LIST": ""
|
||||
"End of MOTD command": ""
|
||||
"End of NAMES list": ""
|
||||
"End of WHO list": ""
|
||||
"End of WHOWAS": ""
|
||||
"End of list": ""
|
||||
"Erroneous nickname": ""
|
||||
"Fake source must be a valid nickname": ""
|
||||
"First param must be a mask or channel": ""
|
||||
"HELPOP <argument>\n\nGet an explanation of <argument>, or \"index\" for a list of help topics.": ""
|
||||
"Help not found": ""
|
||||
"I have %d clients and %d servers": ""
|
||||
"Insufficient oper privs": ""
|
||||
"Invalid CAP subcommand": ""
|
||||
"JOIN 0 is not allowed": ""
|
||||
"Language preferences have been set": ""
|
||||
"Languages are not supported by this server": ""
|
||||
"MOTD File is missing": ""
|
||||
"Malformed username": ""
|
||||
"Mask isn't valid": ""
|
||||
"NickServ is not yet implemented, sorry! To register an account, check /HELPOP REG": ""
|
||||
"Nickname is already in use": ""
|
||||
"No DLINEs have been set!": ""
|
||||
"No command given": ""
|
||||
"No masks given": ""
|
||||
"No nickname given": ""
|
||||
"No such channel": ""
|
||||
"No such nick": ""
|
||||
"No such server": ""
|
||||
"No topic is set": ""
|
||||
"Not enough parameters": ""
|
||||
"Only channel founders can change registered channels": ""
|
||||
"PROXY command is not usable from your address": ""
|
||||
"Password incorrect": ""
|
||||
"Permission Denied": ""
|
||||
"Permission Denied - You're not an IRC operator": ""
|
||||
"Proxied IP address is not valid: [%s]": ""
|
||||
"Received malformed line": ""
|
||||
"Rehashing": ""
|
||||
"Remote servers not yet supported": ""
|
||||
"Removed D-Line for %s": ""
|
||||
"Removed K-Line for %s": ""
|
||||
"SASL authentication aborted": ""
|
||||
"SASL authentication failed": ""
|
||||
"SASL authentication failed, you are not connecting with a certificate": ""
|
||||
"SASL authentication failed: Bad account name": ""
|
||||
"SASL authentication failed: Invalid auth blob": ""
|
||||
"SASL authentication failed: Invalid b64 encoding": ""
|
||||
"SASL authentication failed: Passphrase too long": ""
|
||||
"SASL authentication failed: authcid and authzid should be the same": ""
|
||||
"SASL authentication successful": ""
|
||||
"SASL message too long": ""
|
||||
"Server notice masks": ""
|
||||
"Sorry, I don't know that command": ""
|
||||
"Syntax: REGISTER <channel>": ""
|
||||
"There are %d users and %d invisible on %d server(s)": ""
|
||||
"There was no such nickname": ""
|
||||
"They aren't on that channel": ""
|
||||
"This ban matches you. To DLINE yourself, you must use the command: /DLINE MYSELF <arguments>": ""
|
||||
"This ban matches you. To KLINE yourself, you must use the command: /KLINE MYSELF <arguments>": ""
|
||||
"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 was created %s": ""
|
||||
"Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it": ""
|
||||
"Unknown command": ""
|
||||
"Unknown subcommand": ""
|
||||
"User doesn't have roleplaying mode enabled": ""
|
||||
"VERIFY is not yet implemented": ""
|
||||
"WEBIRC command is not usable from your address or incorrect password given": ""
|
||||
"Welcome to the Internet Relay Network %s": ""
|
||||
"You are banned from this server (%s)": ""
|
||||
"You are no longer marked as being away": ""
|
||||
"You are not using a TLS certificate": ""
|
||||
"You are now an IRC operator": ""
|
||||
"You are now logged in as %s": ""
|
||||
"You have been banned from this server (%s)": ""
|
||||
"You have been marked as being away": ""
|
||||
"You may not reregister": ""
|
||||
"You must be an oper on the channel to register it": ""
|
||||
"You must be logged in to register a channel": ""
|
||||
"You need to register before you can use that command": ""
|
||||
"You need to run a command": ""
|
||||
"You specified too many languages": ""
|
||||
"You're already logged into an account": ""
|
||||
"You're already opered-up!": ""
|
||||
"You're not a channel operator": ""
|
||||
"You're not on that channel": ""
|
||||
"Your host is %s, running version %s": ""
|
||||
"can speak these languages": ""
|
||||
"has client certificate fingerprint %s": ""
|
||||
"is a $bBot$b on %s": ""
|
||||
"is an unknown mode character to me": ""
|
||||
"is logged in as": ""
|
||||
"is using a secure connection": ""
|
||||
"seconds idle, signon time": ""
|
||||
|
57
updatetranslations.py
Executable file
57
updatetranslations.py
Executable file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
# updatetranslations.py
|
||||
#
|
||||
# tl;dr this script updates our translation file with the newest, coolest strings we've added!
|
||||
# it manually searches the source code, extracts strings and then updates the language files.
|
||||
|
||||
# Written in 2018 by Daniel Oaks <daniel@danieloaks.net>
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
#
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along
|
||||
# with this software. If not, see
|
||||
# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
"""updatetranslations.py
|
||||
|
||||
Usage:
|
||||
updatetranslations.py run <irc-dir> <languages-dir>
|
||||
updatetranslations.py --version
|
||||
updatetranslations.py (-h | --help)
|
||||
|
||||
Options:
|
||||
<irc-dir> Oragono's irc subdirectory where the Go code is kept.
|
||||
<languages-dir> Languages directory."""
|
||||
import os
|
||||
import re
|
||||
|
||||
from docopt import docopt
|
||||
import yaml
|
||||
|
||||
if __name__ == '__main__':
|
||||
arguments = docopt(__doc__, version="0.1.0")
|
||||
|
||||
if arguments['run']:
|
||||
lang_strings = []
|
||||
|
||||
for subdir, dirs, files in os.walk(arguments['<irc-dir>']):
|
||||
for fname in files:
|
||||
filepath = subdir + os.sep + fname
|
||||
if filepath.endswith('.go'):
|
||||
content = open(filepath, 'r').read()
|
||||
|
||||
matches = re.findall(r'\.t\("((?:[^"]|\\")+)"\)', content)
|
||||
for match in matches:
|
||||
if match not in lang_strings:
|
||||
lang_strings.append(match)
|
||||
|
||||
matches = re.findall(r'\.t\(\`([^\`]+)\`\)', content)
|
||||
for match in matches:
|
||||
match = match.replace("\n", "\\n").replace("\"", "\\\"")
|
||||
if match not in lang_strings:
|
||||
lang_strings.append(match)
|
||||
|
||||
for match in sorted(lang_strings):
|
||||
print(' "' + match + '": ""')
|
Loading…
Reference in New Issue
Block a user