From 2542d98ec6c05ab447b6a6ffc248e9b133aa1e6d Mon Sep 17 00:00:00 2001 From: FallenDeity <61227305+FallenDeity@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:31:08 +0530 Subject: [PATCH] feat: add gettext utility script --- examples/smart-sync/README.md | 2 +- examples/smart-sync/main.py | 3 +-- examples/smart-sync/utils/__init__.py | 9 +++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 examples/smart-sync/utils/__init__.py diff --git a/examples/smart-sync/README.md b/examples/smart-sync/README.md index c467570..b29fb71 100644 --- a/examples/smart-sync/README.md +++ b/examples/smart-sync/README.md @@ -31,4 +31,4 @@ done ```bash find . -iname "*.po" | xargs -I {} sh -c 'msgfmt -o $(dirname {})/$(basename {} .po).mo {}' -``` \ No newline at end of file +``` diff --git a/examples/smart-sync/main.py b/examples/smart-sync/main.py index c04f14e..ec016ca 100644 --- a/examples/smart-sync/main.py +++ b/examples/smart-sync/main.py @@ -11,8 +11,7 @@ import discord from discord.ext import commands from dotenv import load_dotenv -from utils.translator import GettextTranslator -from utils.tree import SlashCommandTree +from utils import GettextTranslator, SlashCommandTree class CustomBot(commands.Bot): diff --git a/examples/smart-sync/utils/__init__.py b/examples/smart-sync/utils/__init__.py new file mode 100644 index 0000000..2988e6e --- /dev/null +++ b/examples/smart-sync/utils/__init__.py @@ -0,0 +1,9 @@ +import typing + +from .translator import GettextTranslator +from .tree import SlashCommandTree + +__all__: typing.Final[typing.Sequence[str]] = ( + "GettextTranslator", + "SlashCommandTree", +)