Ruby-Cogs/rubycore/rubycore.py
Valerie 7af05d5464
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
test
2025-04-28 14:18:11 -04:00

21 lines
582 B
Python

from redbot.core import commands, i18n
import pathlib
_ = i18n.Translator("RubyCore", __file__)
class RubyCore(commands.Cog):
"""RubyCore Cog"""
def __init__(self, bot):
self.bot = bot
self._load_translations()
def _load_translations(self):
locale_path = pathlib.Path(__file__).parent / "locales"
for po_file in locale_path.glob("*.po"):
lang = po_file.stem.replace("_", "-") # en_US -> en-US
i18n.register_translations(
"RubyCore",
lang,
po_file
)