[i18n] Use redgettext over pygettext (#2023)

* [i18n] Use redgettext over pygettext

* Clear out autogenerated `messages.pot` files

* Remove redundant `regen_messages.py` files

* Refactor `generate_strings.py` to use redgettext

* Install redgettext in Travis Crowdin job

* Clean up some problematic usages of gettext function

* Reformat

* Replace generate_strings.py with Makefile argument

* Update to redgettext 2.1, use exclusion pattern

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine
2018-08-26 23:35:42 +10:00
committed by GitHub
parent dbed24aaca
commit 1b196bf0fb
43 changed files with 21 additions and 2000 deletions

View File

@@ -239,7 +239,7 @@ class General:
except:
await ctx.send(
_(("No Urban dictionary entries were found or there was an error in the process"))
_("No Urban dictionary entries were found or there was an error in the process")
)
if data.get("error") != 404:
@@ -249,7 +249,7 @@ class General:
embeds = []
for ud in data["list"]:
embed = discord.Embed()
embed.title = _("{} by {}".format(ud["word"].capitalize(), ud["author"]))
embed.title = _("{} by {}").format(ud["word"].capitalize(), ud["author"])
embed.url = ud["permalink"]
description = "{} \n \n **Example : ** {}".format(
@@ -257,13 +257,11 @@ class General:
)
if len(description) > 2048:
description = "{}...".format(description[:2045])
embed.description = _(description)
embed.description = description
embed.set_footer(
text=_(
"{} Down / {} Up , Powered by urban dictionary".format(
ud["thumbs_down"], ud["thumbs_up"]
)
text=_("{} Down / {} Up , Powered by urban dictionary").format(
ud["thumbs_down"], ud["thumbs_up"]
)
)
embeds.append(embed)
@@ -280,14 +278,17 @@ class General:
else:
messages = []
for ud in data["list"]:
description = "{} \n \n **Example : ** {}".format(
description = _("{} \n \n **Example : ** {}").format(
ud["definition"], ud.get("example", "N/A")
)
if len(description) > 2048:
description = "{}...".format(description[:2045])
description = _(description)
description = description
message = "<{}> \n {} by {} \n \n {} \n \n {} Down / {} Up , Powered by urban dictionary".format(
message = _(
"<{}> \n {} by {} \n \n {} \n \n {} Down / {} Up, Powered by urban "
"dictionary"
).format(
ud["permalink"],
ud["word"].capitalize(),
ud["author"],
@@ -308,6 +309,6 @@ class General:
)
else:
await ctx.send(
_(("No Urban dictionary entries were found or there was an error in the process"))
_("No Urban dictionary entries were found or there was an error in the process")
)
return