From 6605115941a67a6757dcd1bc9ab135edfd5adde7 Mon Sep 17 00:00:00 2001 From: Romain J Date: Wed, 18 Sep 2019 12:30:49 +0200 Subject: [PATCH] refactor(hierarchy): change first_run and locales path Put first_run and locales dirs to extras --- cogs/utils/lang.py | 2 +- {first_run => extras/first_run}/__init__.py | 0 {first_run => extras/first_run}/initializer.py | 0 {first_run => extras/first_run}/langs.py | 0 {locales => extras/locales}/en/LC_MESSAGES/admin.mo | Bin {locales => extras/locales}/en/LC_MESSAGES/admin.po | 0 {locales => extras/locales}/en/LC_MESSAGES/base.mo | Bin {locales => extras/locales}/en/LC_MESSAGES/base.po | 0 .../locales}/en/LC_MESSAGES/basics.mo | Bin .../locales}/en/LC_MESSAGES/basics.po | 0 {locales => extras/locales}/en/LC_MESSAGES/utils.mo | Bin {locales => extras/locales}/en/LC_MESSAGES/utils.po | 0 {locales => extras/locales}/fr/LC_MESSAGES/admin.mo | Bin {locales => extras/locales}/fr/LC_MESSAGES/admin.po | 0 {locales => extras/locales}/fr/LC_MESSAGES/base.mo | Bin {locales => extras/locales}/fr/LC_MESSAGES/base.po | 0 .../locales}/fr/LC_MESSAGES/basics.mo | Bin .../locales}/fr/LC_MESSAGES/basics.po | 0 {locales => extras/locales}/fr/LC_MESSAGES/utils.mo | Bin {locales => extras/locales}/fr/LC_MESSAGES/utils.po | 0 launcher.py | 2 +- 21 files changed, 2 insertions(+), 2 deletions(-) rename {first_run => extras/first_run}/__init__.py (100%) rename {first_run => extras/first_run}/initializer.py (100%) rename {first_run => extras/first_run}/langs.py (100%) rename {locales => extras/locales}/en/LC_MESSAGES/admin.mo (100%) rename {locales => extras/locales}/en/LC_MESSAGES/admin.po (100%) rename {locales => extras/locales}/en/LC_MESSAGES/base.mo (100%) rename {locales => extras/locales}/en/LC_MESSAGES/base.po (100%) rename {locales => extras/locales}/en/LC_MESSAGES/basics.mo (100%) rename {locales => extras/locales}/en/LC_MESSAGES/basics.po (100%) rename {locales => extras/locales}/en/LC_MESSAGES/utils.mo (100%) rename {locales => extras/locales}/en/LC_MESSAGES/utils.po (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/admin.mo (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/admin.po (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/base.mo (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/base.po (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/basics.mo (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/basics.po (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/utils.mo (100%) rename {locales => extras/locales}/fr/LC_MESSAGES/utils.po (100%) diff --git a/cogs/utils/lang.py b/cogs/utils/lang.py index fabb78d..cd00c01 100644 --- a/cogs/utils/lang.py +++ b/cogs/utils/lang.py @@ -5,7 +5,7 @@ import config class Texts: def __init__(self, base: str = 'base'): self.locale = config.locale - self.texts = gettext.translation(base, localedir='locales', + self.texts = gettext.translation(base, localedir='extras/locales', languages=[self.locale]) self.texts.install() diff --git a/first_run/__init__.py b/extras/first_run/__init__.py similarity index 100% rename from first_run/__init__.py rename to extras/first_run/__init__.py diff --git a/first_run/initializer.py b/extras/first_run/initializer.py similarity index 100% rename from first_run/initializer.py rename to extras/first_run/initializer.py diff --git a/first_run/langs.py b/extras/first_run/langs.py similarity index 100% rename from first_run/langs.py rename to extras/first_run/langs.py diff --git a/locales/en/LC_MESSAGES/admin.mo b/extras/locales/en/LC_MESSAGES/admin.mo similarity index 100% rename from locales/en/LC_MESSAGES/admin.mo rename to extras/locales/en/LC_MESSAGES/admin.mo diff --git a/locales/en/LC_MESSAGES/admin.po b/extras/locales/en/LC_MESSAGES/admin.po similarity index 100% rename from locales/en/LC_MESSAGES/admin.po rename to extras/locales/en/LC_MESSAGES/admin.po diff --git a/locales/en/LC_MESSAGES/base.mo b/extras/locales/en/LC_MESSAGES/base.mo similarity index 100% rename from locales/en/LC_MESSAGES/base.mo rename to extras/locales/en/LC_MESSAGES/base.mo diff --git a/locales/en/LC_MESSAGES/base.po b/extras/locales/en/LC_MESSAGES/base.po similarity index 100% rename from locales/en/LC_MESSAGES/base.po rename to extras/locales/en/LC_MESSAGES/base.po diff --git a/locales/en/LC_MESSAGES/basics.mo b/extras/locales/en/LC_MESSAGES/basics.mo similarity index 100% rename from locales/en/LC_MESSAGES/basics.mo rename to extras/locales/en/LC_MESSAGES/basics.mo diff --git a/locales/en/LC_MESSAGES/basics.po b/extras/locales/en/LC_MESSAGES/basics.po similarity index 100% rename from locales/en/LC_MESSAGES/basics.po rename to extras/locales/en/LC_MESSAGES/basics.po diff --git a/locales/en/LC_MESSAGES/utils.mo b/extras/locales/en/LC_MESSAGES/utils.mo similarity index 100% rename from locales/en/LC_MESSAGES/utils.mo rename to extras/locales/en/LC_MESSAGES/utils.mo diff --git a/locales/en/LC_MESSAGES/utils.po b/extras/locales/en/LC_MESSAGES/utils.po similarity index 100% rename from locales/en/LC_MESSAGES/utils.po rename to extras/locales/en/LC_MESSAGES/utils.po diff --git a/locales/fr/LC_MESSAGES/admin.mo b/extras/locales/fr/LC_MESSAGES/admin.mo similarity index 100% rename from locales/fr/LC_MESSAGES/admin.mo rename to extras/locales/fr/LC_MESSAGES/admin.mo diff --git a/locales/fr/LC_MESSAGES/admin.po b/extras/locales/fr/LC_MESSAGES/admin.po similarity index 100% rename from locales/fr/LC_MESSAGES/admin.po rename to extras/locales/fr/LC_MESSAGES/admin.po diff --git a/locales/fr/LC_MESSAGES/base.mo b/extras/locales/fr/LC_MESSAGES/base.mo similarity index 100% rename from locales/fr/LC_MESSAGES/base.mo rename to extras/locales/fr/LC_MESSAGES/base.mo diff --git a/locales/fr/LC_MESSAGES/base.po b/extras/locales/fr/LC_MESSAGES/base.po similarity index 100% rename from locales/fr/LC_MESSAGES/base.po rename to extras/locales/fr/LC_MESSAGES/base.po diff --git a/locales/fr/LC_MESSAGES/basics.mo b/extras/locales/fr/LC_MESSAGES/basics.mo similarity index 100% rename from locales/fr/LC_MESSAGES/basics.mo rename to extras/locales/fr/LC_MESSAGES/basics.mo diff --git a/locales/fr/LC_MESSAGES/basics.po b/extras/locales/fr/LC_MESSAGES/basics.po similarity index 100% rename from locales/fr/LC_MESSAGES/basics.po rename to extras/locales/fr/LC_MESSAGES/basics.po diff --git a/locales/fr/LC_MESSAGES/utils.mo b/extras/locales/fr/LC_MESSAGES/utils.mo similarity index 100% rename from locales/fr/LC_MESSAGES/utils.mo rename to extras/locales/fr/LC_MESSAGES/utils.mo diff --git a/locales/fr/LC_MESSAGES/utils.po b/extras/locales/fr/LC_MESSAGES/utils.po similarity index 100% rename from locales/fr/LC_MESSAGES/utils.po rename to extras/locales/fr/LC_MESSAGES/utils.po diff --git a/launcher.py b/launcher.py index c759ad5..f13a703 100644 --- a/launcher.py +++ b/launcher.py @@ -14,7 +14,7 @@ try: import config from cogs.utils.lang import Texts except ModuleNotFoundError: - import first_run + import extras.first_run @contextlib.contextmanager