Reverted incorrect internationalization in objects.py
This commit is contained in:
parent
fd2f762730
commit
882a70ae4b
1 changed files with 16 additions and 19 deletions
|
|
@ -9,7 +9,6 @@ from builtins import object
|
||||||
from future.utils import listvalues, with_metaclass
|
from future.utils import listvalues, with_metaclass
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
|
|
||||||
from evennia.typeclasses.models import TypeclassBase
|
from evennia.typeclasses.models import TypeclassBase
|
||||||
from evennia.typeclasses.attributes import NickHandler
|
from evennia.typeclasses.attributes import NickHandler
|
||||||
|
|
@ -1098,9 +1097,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
loc_name = ""
|
loc_name = ""
|
||||||
loc_name = self.location.name
|
loc_name = self.location.name
|
||||||
dest_name = destination.name
|
dest_name = destination.name
|
||||||
string = _("{name} is leaving {loc_name}, heading for {dest_name}.").format(
|
string = "%s is leaving %s, heading for %s."
|
||||||
name=name, loc_name=loc_name, dest_name=dest_name)
|
self.location.msg_contents(string % (name, loc_name, dest_name), exclude=self)
|
||||||
self.location.msg_contents(string, exclude=self)
|
|
||||||
|
|
||||||
def announce_move_to(self, source_location):
|
def announce_move_to(self, source_location):
|
||||||
"""
|
"""
|
||||||
|
|
@ -1116,7 +1114,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
if not source_location and self.location.has_player:
|
if not source_location and self.location.has_player:
|
||||||
# This was created from nowhere and added to a player's
|
# This was created from nowhere and added to a player's
|
||||||
# inventory; it's probably the result of a create command.
|
# inventory; it's probably the result of a create command.
|
||||||
string = _("You now have %s in your possession.") % name
|
string = "You now have %s in your possession." % name
|
||||||
self.location.msg(string)
|
self.location.msg(string)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -1124,9 +1122,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
loc_name = self.location.name
|
loc_name = self.location.name
|
||||||
if source_location:
|
if source_location:
|
||||||
src_name = source_location.name
|
src_name = source_location.name
|
||||||
string = _("{name} arrives to {loc_name} from {src_name}.").format(
|
string = "%s arrives to %s from %s."
|
||||||
name=name, loc_name=loc_name, src_name=src_name)
|
self.location.msg_contents(string % (name, loc_name, src_name), exclude=self)
|
||||||
self.location.msg_contents(string, exclude=self)
|
|
||||||
|
|
||||||
def at_after_move(self, source_location):
|
def at_after_move(self, source_location):
|
||||||
"""
|
"""
|
||||||
|
|
@ -1284,14 +1281,14 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
else:
|
else:
|
||||||
things.append(key)
|
things.append(key)
|
||||||
# get description, build string
|
# get description, build string
|
||||||
string = _("{c%s{n\n" % self.get_display_name(looker))
|
string = "{c%s{n\n" % self.get_display_name(looker)
|
||||||
desc = self.db.desc
|
desc = self.db.desc
|
||||||
if desc:
|
if desc:
|
||||||
string += "%s" % desc
|
string += "%s" % desc
|
||||||
if exits:
|
if exits:
|
||||||
string += _("\n{wExits:{n " + ", ".join(exits))
|
string += "\n{wExits:{n " + ", ".join(exits)
|
||||||
if users or things:
|
if users or things:
|
||||||
string += _("\n{wYou see:{n " + ", ".join(users + things))
|
string += "\n{wYou see:{n " + ", ".join(users + things)
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def at_look(self, target):
|
def at_look(self, target):
|
||||||
|
|
@ -1311,7 +1308,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not target.access(self, "view"):
|
if not target.access(self, "view"):
|
||||||
return _("Could not find '%s'.") % target
|
return "Could not find '%s'." % target
|
||||||
# the target's at_desc() method.
|
# the target's at_desc() method.
|
||||||
target.at_desc(looker=self)
|
target.at_desc(looker=self)
|
||||||
return target.return_appearance(self)
|
return target.return_appearance(self)
|
||||||
|
|
@ -1430,7 +1427,7 @@ class DefaultCharacter(DefaultObject):
|
||||||
self.db.prelogout_location = self.location
|
self.db.prelogout_location = self.location
|
||||||
self.location.at_object_receive(self, self.location)
|
self.location.at_object_receive(self, self.location)
|
||||||
else:
|
else:
|
||||||
player.msg(_("{r%s has no location and no home is set.{n") % self, session=session)
|
player.msg("{r%s has no location and no home is set.{n" % self, session=session)
|
||||||
|
|
||||||
def at_post_puppet(self):
|
def at_post_puppet(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -1438,11 +1435,11 @@ class DefaultCharacter(DefaultObject):
|
||||||
Player<->Object links have been established.
|
Player<->Object links have been established.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.msg(_("\nYou become {c%s{n.\n") % self.name)
|
self.msg("\nYou become {c%s{n.\n" % self.name)
|
||||||
self.msg(self.at_look(self.location))
|
self.msg(self.at_look(self.location))
|
||||||
|
|
||||||
def message(obj, from_obj):
|
def message(obj, from_obj):
|
||||||
obj.msg(_("%s has entered the game.") % self.get_display_name(obj), from_obj=from_obj)
|
obj.msg("%s has entered the game." % self.get_display_name(obj), from_obj=from_obj)
|
||||||
self.location.for_contents(message, exclude=[self], from_obj=self)
|
self.location.for_contents(message, exclude=[self], from_obj=self)
|
||||||
|
|
||||||
def at_post_unpuppet(self, player, session=None):
|
def at_post_unpuppet(self, player, session=None):
|
||||||
|
|
@ -1461,7 +1458,7 @@ class DefaultCharacter(DefaultObject):
|
||||||
# only remove this char from grid if no sessions control it anymore.
|
# only remove this char from grid if no sessions control it anymore.
|
||||||
if self.location:
|
if self.location:
|
||||||
def message(obj, from_obj):
|
def message(obj, from_obj):
|
||||||
obj.msg(_("%s has left the game.") % self.get_display_name(obj), from_obj=from_obj)
|
obj.msg("%s has left the game." % self.get_display_name(obj), from_obj=from_obj)
|
||||||
self.location.for_contents(message, exclude=[self], from_obj=self)
|
self.location.for_contents(message, exclude=[self], from_obj=self)
|
||||||
self.db.prelogout_location = self.location
|
self.db.prelogout_location = self.location
|
||||||
self.location = None
|
self.location = None
|
||||||
|
|
@ -1528,9 +1525,9 @@ class ExitCommand(command.Command):
|
||||||
A string with identifying information to disambiguate the command, conventionally with a preceding space.
|
A string with identifying information to disambiguate the command, conventionally with a preceding space.
|
||||||
"""
|
"""
|
||||||
if self.obj.destination:
|
if self.obj.destination:
|
||||||
return _(" (exit to %s)") % self.obj.destination.get_display_name(caller)
|
return " (exit to %s)" % self.obj.destination.get_display_name(caller)
|
||||||
else:
|
else:
|
||||||
return _(" (%s)") % self.obj.get_display_name(caller)
|
return " (%s)" % self.obj.get_display_name(caller)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Base Exit object
|
# Base Exit object
|
||||||
|
|
@ -1667,4 +1664,4 @@ class DefaultExit(DefaultObject):
|
||||||
read for an error string instead.
|
read for an error string instead.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
traversing_object.msg(_("You cannot go there."))
|
traversing_object.msg("You cannot go there.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue