diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | setup.cfg | 14 | ||||
-rw-r--r-- | src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po (renamed from src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po) | 0 | ||||
-rw-r--r-- | src/hydrilla/util/_util.py | 6 |
5 files changed, 13 insertions, 13 deletions
@@ -10,5 +10,5 @@ dist *.pyc setuptools src/hydrilla/builder/_version.py -src/hydrilla/builder/locales/messages.pot -messages.mo
\ No newline at end of file +src/hydrilla/builder/locales/hydrilla-messages.pot +hydrilla-messages.mo diff --git a/MANIFEST.in b/MANIFEST.in index 3a51409..abc39da 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,6 @@ # Available under the terms of Creative Commons Zero v1.0 Universal. include src/hydrilla/schemas/*.schema.json* -include src/hydrilla/builder/locales/*/LC_MESSAGES/messages.po +include src/hydrilla/builder/locales/*/LC_MESSAGES/hydrilla-messages.po include src/test/source-package-example/* global-exclude .git .gitignore .gitmodules @@ -40,7 +40,7 @@ install_requires = # reuse [options.package_data] -hydrilla.builder = locales/*/LC_MESSAGES/messages.mo +hydrilla.builder = locales/*/LC_MESSAGES/hydrilla-messages.mo [options.extras_require] test = pytest @@ -59,22 +59,22 @@ console_scripts = keywords = _ width = 80 input_dirs = src/hydrilla -output_file = src/hydrilla/builder/locales/messages.pot +output_file = src/hydrilla/builder/locales/hydrilla-messages.pot msgid_bugs_address = koszko@koszko.org sort_by_file = True copyright_holder = Wojtek Kosior <koszko@koszko.org> [init_catalog] -input_file = src/hydrilla/builder/locales/messages.pot +input_file = src/hydrilla/builder/locales/hydrilla-messages.pot output_dir = src/hydrilla/builder/locales/ -domain = messages +domain = hydrilla-messages [update_catalog] -input_file = src/hydrilla/builder/locales/messages.pot +input_file = src/hydrilla/builder/locales/hydrilla-messages.pot output_dir = src/hydrilla/builder/locales/ -domain = messages +domain = hydrilla-messages [compile_catalog] directory = src/hydrilla/builder/locales use_fuzzy = True -domain = messages +domain = hydrilla-messages diff --git a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po index 8c08413..8c08413 100644 --- a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po +++ b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po diff --git a/src/hydrilla/util/_util.py b/src/hydrilla/util/_util.py index 62843f4..46baa0e 100644 --- a/src/hydrilla/util/_util.py +++ b/src/hydrilla/util/_util.py @@ -136,8 +136,8 @@ def validator_for(schema_filename: str) -> Draft7Validator: def translation(localedir: Union[Path, str], lang: Optional[str]=None) \ -> gettext.GNUTranslations: """ - Configure translations for domain 'messages' and return the object that - represents them. + Configure translations for domain 'hydrilla-messages' and return the object + that represents them. If `lang` is set, look for translations for `lang`. Otherwise, try to determine system's default language and use that. @@ -151,7 +151,7 @@ def translation(localedir: Union[Path, str], lang: Optional[str]=None) \ except: lang = locale.getdefaultlocale()[0] or 'C' - return gettext.translation('messages', localedir=localedir, + return gettext.translation('hydrilla-messages', localedir=localedir, languages=[lang, 'en_US']) _ = translation(here.parent / 'builder' / 'locales').gettext |