Skip to content

Commit 46443b0

Browse files
Added aliases for translations
1 parent d591dda commit 46443b0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

data/translations/places.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
},
8787
{
8888
"english": "Swinedimples Academy",
89+
"alias": "Swinedimples",
8990
"japanese": "エルシオン学院",
9091
"spanish": "Academia Paracelso",
9192
"french": "École Saint-Sévaire",

main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ async def _translate(ctx, phrase: Option(str, "Word or Phrase (Ex. Copper Sword)
135135
index = next(filter(lambda t: clean_text(
136136
t.get(parsers.translation_languages_simple[parsers.translation_languages.index(language_input)],
137137
"").lower()) == clean_text(phrase.lower()), translations), None)
138+
if index is None:
139+
index = next(
140+
filter(lambda t: clean_text(t.get("alias", "").lower()) == clean_text(phrase.lower()), translations), None)
141+
138142
if index is None:
139143
embed = create_embed("No word or phrase found matching `%s`. Please check phrase and try again." % phrase,
140144
error="Any errors? Want to contribute data? Please speak to %s" % dev_tag)

0 commit comments

Comments
 (0)