[V3 i18n] Internationalise help for commands and cogs (#1143)

* Framework for internationalised command help

* Translator for class docstring of cog

* Remove references to old context module

* Use CogManagerUI as PoC

* Replace all references to RedContext

* Rename CogI18n object to avoid confusion

* Update docs

* Update i18n docs.

* Store translators in list instead of dict

* Change commands module to package, updated refs in cogs

* Updated docs and more references in cogs

* Resolve syntax error

* Update from merge
This commit is contained in:
Tobotimus
2018-05-12 09:47:49 +10:00
committed by Kowlin
parent 1e60d1c265
commit 15ea5440a3
35 changed files with 575 additions and 259 deletions

View File

@@ -7,10 +7,10 @@ Ported to Red V3 by Palm__ (https://github.com/palmtree5)
import asyncio
import discord
from redbot.core import RedContext
from redbot.core import commands
async def menu(ctx: RedContext, pages: list,
async def menu(ctx: commands.Context, pages: list,
controls: dict,
message: discord.Message=None, page: int=0,
timeout: float=30.0):
@@ -28,7 +28,7 @@ async def menu(ctx: RedContext, pages: list,
Parameters
----------
ctx: RedContext
ctx: commands.Context
The command context
pages: `list` of `str` or `discord.Embed`
The pages of the menu.
@@ -92,7 +92,7 @@ async def menu(ctx: RedContext, pages: list,
timeout, react.emoji)
async def next_page(ctx: RedContext, pages: list,
async def next_page(ctx: commands.Context, pages: list,
controls: dict, message: discord.Message, page: int,
timeout: float, emoji: str):
perms = message.channel.permissions_for(ctx.guild.me)
@@ -109,7 +109,7 @@ async def next_page(ctx: RedContext, pages: list,
page=page, timeout=timeout)
async def prev_page(ctx: RedContext, pages: list,
async def prev_page(ctx: commands.Context, pages: list,
controls: dict, message: discord.Message, page: int,
timeout: float, emoji: str):
perms = message.channel.permissions_for(ctx.guild.me)
@@ -126,7 +126,7 @@ async def prev_page(ctx: RedContext, pages: list,
page=next_page, timeout=timeout)
async def close_menu(ctx: RedContext, pages: list,
async def close_menu(ctx: commands.Context, pages: list,
controls: dict, message: discord.Message, page: int,
timeout: float, emoji: str):
if message: