From: Oleg Broytman Date: Thu, 24 Dec 2020 22:43:29 +0000 (+0300) Subject: Fix(translations): Fix importing from `translations` X-Git-Tag: 0.1.6~19 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=16e5047ee2143645c07c3555ff6e4ce605c7614d;p=m_librarian.git Fix(translations): Fix importing from `translations` Rename `translations/` -> `translations_dir/` to avoid clashing with `translations.py`. --- 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', ] },