Support missing .po files (#2068)

* [V3 Core] Support missing .po files

* Modified if-state

* Use PEP8 recommendation for empty list check

https://www.python.org/dev/peps/pep-0008/#programming-recommendations
This commit is contained in:
El Laggron
2018-09-03 07:44:58 +02:00
committed by Toby Harradine
parent c0c5535005
commit 85354f2722

View File

@@ -1066,6 +1066,9 @@ class Core(CoreLogic):
red_dist = pkg_resources.get_distribution("red-discordbot")
red_path = Path(red_dist.location) / "redbot"
locale_list = sorted(set([loc.stem for loc in list(red_path.glob("**/*.po"))]))
if not locale_list:
await ctx.send("No languages found.")
return
pages = pagify("\n".join(locale_list))
await ctx.send_interactive(pages, box_lang="Available Locales:")