mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
[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:
@@ -8,11 +8,10 @@ from typing import Tuple, Union, List
|
||||
import redbot.cogs
|
||||
import discord
|
||||
|
||||
from . import checks
|
||||
from . import checks, commands
|
||||
from .config import Config
|
||||
from .i18n import CogI18n
|
||||
from .i18n import Translator, cog_i18n
|
||||
from .data_manager import cog_data_path
|
||||
from discord.ext import commands
|
||||
|
||||
from .utils.chat_formatting import box, pagify
|
||||
|
||||
@@ -303,10 +302,13 @@ class CogManager:
|
||||
invalidate_caches()
|
||||
|
||||
|
||||
_ = CogI18n("CogManagerUI", __file__)
|
||||
_ = Translator("CogManagerUI", __file__)
|
||||
|
||||
|
||||
@cog_i18n(_)
|
||||
class CogManagerUI:
|
||||
"""Commands to interface with Red's cog manager."""
|
||||
|
||||
async def visible_paths(self, ctx):
|
||||
install_path = await ctx.bot.cog_mgr.install_path()
|
||||
cog_paths = await ctx.bot.cog_mgr.paths()
|
||||
|
||||
Reference in New Issue
Block a user