From 16e5047ee2143645c07c3555ff6e4ce605c7614d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 25 Dec 2020 01:43:29 +0300 Subject: [PATCH] Fix(translations): Fix importing from `translations` Rename `translations/` -> `translations_dir/` to avoid clashing with `translations.py`. --- m_librarian/translations.py | 2 +- .../{translations => translations_dir}/Makefile | 0 .../{translations => translations_dir}/ru.mo | Bin .../{translations => translations_dir}/ru.po | 0 setup.py | 2 +- 5 files changed, 2 insertions(+), 2 deletions(-) rename m_librarian/{translations => translations_dir}/Makefile (100%) rename m_librarian/{translations => translations_dir}/ru.mo (100%) rename m_librarian/{translations => translations_dir}/ru.po (100%) diff --git a/m_librarian/translations.py b/m_librarian/translations.py index e3cbce4..8542ffb 100644 --- a/m_librarian/translations.py +++ b/m_librarian/translations.py @@ -6,7 +6,7 @@ import os def get_translations(language): mo_filename = os.path.join( - os.path.dirname(__file__), 'translations', language + '.mo') + os.path.dirname(__file__), 'translations_dir', language + '.mo') if os.path.exists(mo_filename): mo_file = open(mo_filename, 'rb') translations = gettext.GNUTranslations(mo_file) diff --git a/m_librarian/translations/Makefile b/m_librarian/translations_dir/Makefile similarity index 100% rename from m_librarian/translations/Makefile rename to m_librarian/translations_dir/Makefile diff --git a/m_librarian/translations/ru.mo b/m_librarian/translations_dir/ru.mo similarity index 100% rename from m_librarian/translations/ru.mo rename to m_librarian/translations_dir/ru.mo diff --git a/m_librarian/translations/ru.po b/m_librarian/translations_dir/ru.po similarity index 100% rename from m_librarian/translations/ru.po rename to m_librarian/translations_dir/ru.po diff --git a/setup.py b/setup.py index 9ae03af..5eb04b5 100755 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ setup( packages=['m_librarian', 'm_librarian.web'], package_data={'m_librarian': [ 'glst/*.txt', 'glst/genres_*.glst', - 'translations/*.mo', 'translations/*.po', + 'translations_dir/*.mo', 'translations_dir/*.po', 'web/static/style.css', 'web/views/*.py', 'web/views/*.tmpl', ] }, -- 2.39.5