mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 12:37:16 +02:00
Cleaned and updated the i18n strings for various server-core system. Removed i18n for all strings that are only visible on stdout or in logs. Still missing i18n on certain specific things such as model field help and attribute warnings. Updated Swedish translation to match.
This commit is contained in:
parent
80da420ee7
commit
4c849ec351
26 changed files with 918 additions and 1420 deletions
|
|
@ -13,7 +13,6 @@ from src.server.models import ServerConfig
|
|||
from src.help.models import HelpEntry
|
||||
from src.utils import create
|
||||
|
||||
# i18n
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
def create_config_values():
|
||||
|
|
@ -34,7 +33,7 @@ def create_objects():
|
|||
Creates the #1 player and Limbo room.
|
||||
"""
|
||||
|
||||
print _(" Creating objects (Player #1 and Limbo room) ...")
|
||||
print " Creating objects (Player #1 and Limbo room) ..."
|
||||
|
||||
# Set the initial User's account object's username on the #1 object.
|
||||
# This object is pure django and only holds name, email and password.
|
||||
|
|
@ -89,7 +88,7 @@ def create_channels():
|
|||
"""
|
||||
Creates some sensible default channels.
|
||||
"""
|
||||
print _(" Creating default channels ...")
|
||||
print " Creating default channels ..."
|
||||
|
||||
# public channel
|
||||
key, aliases, desc, locks = settings.CHANNEL_PUBLIC
|
||||
|
|
@ -112,12 +111,11 @@ def import_MUX_help_files():
|
|||
"""
|
||||
Imports the MUX help files.
|
||||
"""
|
||||
print _(" Importing MUX help database (devel reference only) ...")
|
||||
print " Importing MUX help database (devel reference only) ..."
|
||||
management.call_command('loaddata', '../src/help/mux_help_db.json', verbosity=0)
|
||||
# categorize the MUX help files into its own category.
|
||||
default_category = "MUX"
|
||||
print _(" Moving imported help db to help category '%(default)s'." \
|
||||
% {'default': default_category})
|
||||
print " Moving imported help db to help category '%(default)s'." % {'default': default_category}
|
||||
HelpEntry.objects.all_to_category(default_category)
|
||||
|
||||
def create_system_scripts():
|
||||
|
|
@ -127,7 +125,7 @@ def create_system_scripts():
|
|||
"""
|
||||
from src.scripts import scripts
|
||||
|
||||
print _(" Creating and starting global scripts ...")
|
||||
print " Creating and starting global scripts ..."
|
||||
|
||||
# check so that all sessions are alive.
|
||||
script1 = create.create_script(scripts.CheckSessions)
|
||||
|
|
@ -138,7 +136,7 @@ def create_system_scripts():
|
|||
# clear the attribute cache regularly
|
||||
script4 = create.create_script(scripts.ClearAttributeCache)
|
||||
if not script1 or not script2 or not script3 or not script4:
|
||||
print _(" Error creating system scripts.")
|
||||
print " Error creating system scripts."
|
||||
|
||||
def start_game_time():
|
||||
"""
|
||||
|
|
@ -147,7 +145,7 @@ def start_game_time():
|
|||
the total run time of the server as well as its current uptime
|
||||
(the uptime can also be found directly from the server though).
|
||||
"""
|
||||
print _(" Starting in-game time ...")
|
||||
print " Starting in-game time ..."
|
||||
from src.utils import gametime
|
||||
gametime.init_gametime()
|
||||
|
||||
|
|
@ -170,20 +168,20 @@ def create_admin_media_links():
|
|||
dpath = os.path.join(django.__path__[0], 'contrib', 'admin', 'static', 'admin')
|
||||
apath = os.path.join(settings.ADMIN_MEDIA_ROOT)
|
||||
if os.path.isdir(apath):
|
||||
print _(" ADMIN_MEDIA_ROOT already exists. Ignored.")
|
||||
print " ADMIN_MEDIA_ROOT already exists. Ignored."
|
||||
return
|
||||
if os.name == 'nt':
|
||||
print _(" Admin-media files copied to ADMIN_MEDIA_ROOT (Windows mode).")
|
||||
print " Admin-media files copied to ADMIN_MEDIA_ROOT (Windows mode)."
|
||||
os.mkdir(apath)
|
||||
os.system('xcopy "%s" "%s" /e /q /c' % (dpath, apath))
|
||||
if os.name == 'posix':
|
||||
try:
|
||||
os.symlink(dpath, apath)
|
||||
print _(" Admin-media symlinked to ADMIN_MEDIA_ROOT.")
|
||||
print " Admin-media symlinked to ADMIN_MEDIA_ROOT."
|
||||
except OSError, e:
|
||||
print _(" There was an error symlinking Admin-media to ADMIN_MEDIA_ROOT:\n %s\n -> \n %s\n (%s)\n If you see issues, link manually." % (dpath, apath, e))
|
||||
print " There was an error symlinking Admin-media to ADMIN_MEDIA_ROOT:\n %s\n -> \n %s\n (%s)\n If you see issues, link manually." % (dpath, apath, e)
|
||||
else:
|
||||
print _(" Admin-media files should be copied manually to ADMIN_MEDIA_ROOT.")
|
||||
print " Admin-media files should be copied manually to ADMIN_MEDIA_ROOT."
|
||||
|
||||
def at_initial_setup():
|
||||
"""
|
||||
|
|
@ -199,7 +197,7 @@ def at_initial_setup():
|
|||
mod = __import__(modname, fromlist=[None])
|
||||
except (ImportError, ValueError):
|
||||
return
|
||||
print _(" Running at_initial_setup() hook.")
|
||||
print " Running at_initial_setup() hook."
|
||||
if mod.__dict__.get("at_initial_setup", None):
|
||||
mod.at_initial_setup()
|
||||
|
||||
|
|
@ -211,7 +209,7 @@ def reset_server():
|
|||
It also checks so the warm-reset mechanism works as it should.
|
||||
"""
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
print _(" Initial setup complete. Resetting/reloading Server.")
|
||||
print " Initial setup complete. Resetting/reloading Server."
|
||||
SESSIONS.server.shutdown(mode='reset')
|
||||
|
||||
def handle_setup(last_step):
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ from src.utils.idmapper.models import SharedMemoryModel
|
|||
from src.utils import logger, utils
|
||||
from src.server.manager import ServerConfigManager
|
||||
|
||||
# i18n
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
# ServerConfig
|
||||
|
|
@ -88,7 +85,7 @@ class ServerConfig(SharedMemoryModel):
|
|||
"Setter. Allows for self.value = value"
|
||||
if utils.has_parent('django.db.models.base.Model', value):
|
||||
# we have to protect against storing db objects.
|
||||
logger.log_errmsg(_("ServerConfig cannot store db objects! (%s)" % value))
|
||||
logger.log_errmsg("ServerConfig cannot store db objects! (%s)" % value)
|
||||
return
|
||||
self.db_value = pickle.dumps(value)
|
||||
self.save()
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@ if os.name == 'nt':
|
|||
# For Windows we need to handle pid files manually.
|
||||
PORTAL_PIDFILE = os.path.join(settings.GAME_DIR, 'portal.pid')
|
||||
|
||||
# i18n
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Evennia Portal settings
|
||||
#------------------------------------------------------------
|
||||
|
|
@ -103,7 +100,7 @@ class Portal(object):
|
|||
"""
|
||||
Outputs server startup info to the terminal.
|
||||
"""
|
||||
print _(' %(servername)s Portal (%(version)s) started.') % {'servername': SERVERNAME, 'version': VERSION}
|
||||
print ' %(servername)s Portal (%(version)s) started.' % {'servername': SERVERNAME, 'version': VERSION}
|
||||
if AMP_ENABLED:
|
||||
print " amp (Server): %s" % AMP_PORT
|
||||
if TELNET_ENABLED:
|
||||
|
|
@ -135,7 +132,7 @@ class Portal(object):
|
|||
if mode == None:
|
||||
return
|
||||
f = open(PORTAL_RESTART, 'w')
|
||||
print _("writing mode=%(mode)s to %(portal_restart)s") % {'mode': mode, 'portal_restart': PORTAL_RESTART}
|
||||
print "writing mode=%(mode)s to %(portal_restart)s" % {'mode': mode, 'portal_restart': PORTAL_RESTART}
|
||||
f.write(str(mode))
|
||||
f.close()
|
||||
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ class Evennia(object):
|
|||
if not last_initial_setup_step:
|
||||
# None is only returned if the config does not exist,
|
||||
# i.e. this is an empty DB that needs populating.
|
||||
print _(' Server started for the first time. Setting defaults.')
|
||||
print ' Server started for the first time. Setting defaults.'
|
||||
initial_setup.handle_setup(0)
|
||||
print '-'*50
|
||||
elif int(last_initial_setup_step) >= 0:
|
||||
|
|
@ -180,8 +180,8 @@ class Evennia(object):
|
|||
# modules and setup will resume from this step, retrying
|
||||
# the last failed module. When all are finished, the step
|
||||
# is set to -1 to show it does not need to be run again.
|
||||
print _(' Resuming initial setup from step %(last)s.' % \
|
||||
{'last': last_initial_setup_step})
|
||||
print ' Resuming initial setup from step %(last)s.' % \
|
||||
{'last': last_initial_setup_step}
|
||||
initial_setup.handle_setup(int(last_initial_setup_step))
|
||||
print '-'*50
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ class Evennia(object):
|
|||
"""
|
||||
Outputs server startup info to the terminal.
|
||||
"""
|
||||
print _(' %(servername)s Server (%(version)s) started.') % {'servername': SERVERNAME, 'version': VERSION}
|
||||
print ' %(servername)s Server (%(version)s) started.' % {'servername': SERVERNAME, 'version': VERSION}
|
||||
print ' amp (Portal): %s' % AMP_PORT
|
||||
|
||||
def set_restart_mode(self, mode=None):
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ from src.server import session
|
|||
from src.players.models import PlayerDB
|
||||
from src.utils import ansi, utils, logger
|
||||
|
||||
# i18n
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
||||
CTRL_C = '\x03'
|
||||
|
|
@ -295,7 +292,7 @@ def getKeyPair(pubkeyfile, privkeyfile):
|
|||
|
||||
if not (os.path.exists(pubkeyfile) and os.path.exists(privkeyfile)):
|
||||
# No keypair exists. Generate a new RSA keypair
|
||||
print _(" Generating SSH RSA keypair ..."),
|
||||
print " Generating SSH RSA keypair ...",
|
||||
from Crypto.PublicKey import RSA
|
||||
|
||||
KEY_LENGTH = 1024
|
||||
|
|
@ -340,8 +337,8 @@ def makeFactory(configdict):
|
|||
factory.publicKeys = {'ssh-rsa': publicKey}
|
||||
factory.privateKeys = {'ssh-rsa': privateKey}
|
||||
except Exception, e:
|
||||
print _(" getKeyPair error: %(e)s\n WARNING: Evennia could not auto-generate SSH keypair. Using conch default keys instead.") % {'e': e}
|
||||
print _(" If this error persists, create game/%(pub)s and game/%(priv)s yourself using third-party tools.") % {'pub': pubkeyfile, 'priv': privkeyfile}
|
||||
print " getKeyPair error: %(e)s\n WARNING: Evennia could not auto-generate SSH keypair. Using conch default keys instead." % {'e': e}
|
||||
print " If this error persists, create game/%(pub)s and game/%(priv)s yourself using third-party tools." % {'pub': pubkeyfile, 'priv': privkeyfile}
|
||||
|
||||
factory.services = factory.services.copy()
|
||||
factory.services['ssh-userauth'] = ExtraInfoAuthServer
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from twisted.internet import ssl as twisted_ssl
|
|||
try:
|
||||
import OpenSSL
|
||||
except ImportError:
|
||||
print _(" SSL_ENABLED requires PyOpenSSL.")
|
||||
print " SSL_ENABLED requires PyOpenSSL."
|
||||
sys.exit(5)
|
||||
|
||||
from src.server.telnet import TelnetProtocol
|
||||
|
|
@ -33,7 +33,7 @@ def verify_SSL_key_and_cert(keyfile, certfile):
|
|||
from Crypto.PublicKey import RSA
|
||||
from twisted.conch.ssh.keys import Key
|
||||
|
||||
print _(" Creating SSL key and certificate ... "),
|
||||
print " Creating SSL key and certificate ... ",
|
||||
|
||||
try:
|
||||
# create the RSA key and store it.
|
||||
|
|
@ -42,8 +42,8 @@ def verify_SSL_key_and_cert(keyfile, certfile):
|
|||
keyString = rsaKey.toString(type="OPENSSH")
|
||||
file(keyfile, 'w+b').write(keyString)
|
||||
except Exception,e:
|
||||
print _("rsaKey error: %(e)s\n WARNING: Evennia could not auto-generate SSL private key.") % {'e': e}
|
||||
print _("If this error persists, create game/%(keyfile)s yourself using third-party tools.") % {'keyfile': keyfile}
|
||||
print "rsaKey error: %(e)s\n WARNING: Evennia could not auto-generate SSL private key." % {'e': e}
|
||||
print "If this error persists, create game/%(keyfile)s yourself using third-party tools." % {'keyfile': keyfile}
|
||||
sys.exit(5)
|
||||
|
||||
# try to create the certificate
|
||||
|
|
@ -55,12 +55,14 @@ def verify_SSL_key_and_cert(keyfile, certfile):
|
|||
try:
|
||||
err = subprocess.call(exestring)#, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
except OSError, e:
|
||||
print " %s\n" % e
|
||||
print _(" Evennia's SSL context factory could not automatically create an SSL certificate game/%(cert)s.") % {'cert': certfile}
|
||||
print _(" A private key 'ssl.key' was already created. Please create %(cert)s manually using the commands valid") % {'cert': certfile}
|
||||
print _(" for your operating system.")
|
||||
print _(" Example (linux, using the openssl program): ")
|
||||
print " %s" % exestring
|
||||
string = "\n".join([
|
||||
" %s\n" % e,
|
||||
" Evennia's SSL context factory could not automatically create an SSL certificate game/%(cert)s." % {'cert': certfile},
|
||||
" A private key 'ssl.key' was already created. Please create %(cert)s manually using the commands valid" % {'cert': certfile},
|
||||
" for your operating system.",
|
||||
" Example (linux, using the openssl program): ",
|
||||
" %s" % exestring])
|
||||
print string
|
||||
sys.exit(5)
|
||||
print "done."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue