mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 15:56:30 +01:00
Handle inflex pluralization errror on complex object name. Resolves #2015.
This commit is contained in:
parent
7ee8aa82c8
commit
d1219ea565
1 changed files with 6 additions and 2 deletions
|
|
@ -341,8 +341,12 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
|
|||
"""
|
||||
key = kwargs.get("key", self.key)
|
||||
key = ansi.ANSIString(key) # this is needed to allow inflection of colored names
|
||||
plural = _INFLECT.plural(key, 2)
|
||||
plural = "%s %s" % (_INFLECT.number_to_words(count, threshold=12), plural)
|
||||
try:
|
||||
plural = _INFLECT.plural(key, 2)
|
||||
plural = "%s %s" % (_INFLECT.number_to_words(count, threshold=12), plural)
|
||||
except IndexError:
|
||||
# this is raised by inflect if the input is not a proper noun
|
||||
plural = key
|
||||
singular = _INFLECT.an(key)
|
||||
if not self.aliases.get(plural, category="plural_key"):
|
||||
# we need to wipe any old plurals/an/a in case key changed in the interrim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue