From 7af05d5464f586b4ec105ab94b50ccbfc1afc2de Mon Sep 17 00:00:00 2001 From: Valerie Date: Mon, 28 Apr 2025 14:18:11 -0400 Subject: [PATCH] test --- rubycore/rubycore.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rubycore/rubycore.py b/rubycore/rubycore.py index 2bf1dce..cc554dc 100644 --- a/rubycore/rubycore.py +++ b/rubycore/rubycore.py @@ -1,4 +1,5 @@ from redbot.core import commands, i18n +import pathlib _ = i18n.Translator("RubyCore", __file__) @@ -7,3 +8,14 @@ class RubyCore(commands.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 + )