Merge remote-tracking branch 'origin/development' into development

pull/2127/head^2 v1.2.2-beta.12
morpheus65535 2 years ago
commit b02c1a7e28

@ -156,15 +156,16 @@ class _LanguageEquals(list):
raise ValueError(f"Not a valid equal tuple: {item}") raise ValueError(f"Not a valid equal tuple: {item}")
def translate(self, items: set): def translate(self, items: set):
translated = set() translated = items.copy()
for equals in self: for equals in self:
from_, to_ = equals from_, to_ = equals
if to_ in items: if to_ in items:
logger.debug("Translating %s -> %s", to_, from_) logger.debug("Translating %s -> %s", to_, from_)
translated.add(from_) translated.add(from_)
else:
translated.add(to_) if translated == items:
logger.debug("Nothing to translate found")
return translated or items return translated or items

Loading…
Cancel
Save