From 0fe371dab386dc4aeb08e601a91d61469f2f5f7a Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 22 Feb 2022 11:46:11 +0100 Subject: change translation domain to 'hydrilla-messages' --- .gitignore | 4 +- MANIFEST.in | 2 +- setup.cfg | 14 ++--- .../locales/en_US/LC_MESSAGES/hydrilla-messages.po | 68 ++++++++++++++++++++++ .../builder/locales/en_US/LC_MESSAGES/messages.po | 68 ---------------------- src/hydrilla/util/_util.py | 6 +- 6 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po delete mode 100644 src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po diff --git a/.gitignore b/.gitignore index 1bfce59..6a43e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/setup.cfg b/setup.cfg index 5ab23af..9d9660a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 [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/hydrilla-messages.po b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po new file mode 100644 index 0000000..8c08413 --- /dev/null +++ b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: CC0-1.0 +# +# English (United States) translations for hydrilla.builder. +# Copyright (C) 2022 Wojtek Kosior +# Available under the terms of Creative Commons Zero v1.0 Universal. +msgid "" +msgstr "" +"Project-Id-Version: hydrilla.builder 0.1.dev16+g4e46d7f.d20220211\n" +"Report-Msgid-Bugs-To: koszko@koszko.org\n" +"POT-Creation-Date: 2022-02-12 14:40+0100\n" +"PO-Revision-Date: 2022-02-12 00:00+0000\n" +"Last-Translator: Wojtek Kosior \n" +"Language: en_US\n" +"Language-Team: en_US \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.8.0\n" + +#: src/hydrilla/builder/build.py:107 +msgid "couldnt_import_reuse_is_it_installed" +msgstr "" +"Could not import 'reuse'. Is the tool installed and visible to this " +"Python instance?" + +#: src/hydrilla/builder/build.py:112 +msgid "spdx_report_from_reuse_incompliant" +msgstr "Attempt to generate an SPDX report for a REUSE-incompliant package." + +#: src/hydrilla/builder/build.py:196 +msgid "loading_{}_outside_package_dir" +msgstr "Attempt to load '{}' which lies outside package source directory." + +#: src/hydrilla/builder/build.py:200 +msgid "loading_reserved_index_json" +msgstr "Attempt to load 'index.json' which is a reserved filename." + +#: src/hydrilla/builder/build.py:314 +msgid "report_spdx_not_in_copyright_list" +msgstr "" +"Told to generate 'report.spdx' but 'report.spdx' is not listed among " +"copyright files. Refusing to proceed." + +#: src/hydrilla/builder/build.py:386 +msgid "source_directory_to_build_from" +msgstr "Source directory to build from." + +#: src/hydrilla/builder/build.py:388 +msgid "path_instead_of_index_json" +msgstr "" +"Path to file to be processed instead of index.json (if not absolute, " +"resolved relative to srcdir)." + +#: src/hydrilla/builder/build.py:390 +msgid "built_package_files_destination" +msgstr "Destination directory to write built package files to." + +#: src/hydrilla/builder/build.py:396 +msgid "build_package_from_srcdir_to_dstdir" +msgstr "" +"Build Hydrilla package from `scrdir` and write the resulting files under " +"`dstdir`." + +#: src/hydrilla/util/_util.py:76 +msgid "bad_comment" +msgstr "bad comment" + diff --git a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po b/src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po deleted file mode 100644 index 8c08413..0000000 --- a/src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po +++ /dev/null @@ -1,68 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -# -# English (United States) translations for hydrilla.builder. -# Copyright (C) 2022 Wojtek Kosior -# Available under the terms of Creative Commons Zero v1.0 Universal. -msgid "" -msgstr "" -"Project-Id-Version: hydrilla.builder 0.1.dev16+g4e46d7f.d20220211\n" -"Report-Msgid-Bugs-To: koszko@koszko.org\n" -"POT-Creation-Date: 2022-02-12 14:40+0100\n" -"PO-Revision-Date: 2022-02-12 00:00+0000\n" -"Last-Translator: Wojtek Kosior \n" -"Language: en_US\n" -"Language-Team: en_US \n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.8.0\n" - -#: src/hydrilla/builder/build.py:107 -msgid "couldnt_import_reuse_is_it_installed" -msgstr "" -"Could not import 'reuse'. Is the tool installed and visible to this " -"Python instance?" - -#: src/hydrilla/builder/build.py:112 -msgid "spdx_report_from_reuse_incompliant" -msgstr "Attempt to generate an SPDX report for a REUSE-incompliant package." - -#: src/hydrilla/builder/build.py:196 -msgid "loading_{}_outside_package_dir" -msgstr "Attempt to load '{}' which lies outside package source directory." - -#: src/hydrilla/builder/build.py:200 -msgid "loading_reserved_index_json" -msgstr "Attempt to load 'index.json' which is a reserved filename." - -#: src/hydrilla/builder/build.py:314 -msgid "report_spdx_not_in_copyright_list" -msgstr "" -"Told to generate 'report.spdx' but 'report.spdx' is not listed among " -"copyright files. Refusing to proceed." - -#: src/hydrilla/builder/build.py:386 -msgid "source_directory_to_build_from" -msgstr "Source directory to build from." - -#: src/hydrilla/builder/build.py:388 -msgid "path_instead_of_index_json" -msgstr "" -"Path to file to be processed instead of index.json (if not absolute, " -"resolved relative to srcdir)." - -#: src/hydrilla/builder/build.py:390 -msgid "built_package_files_destination" -msgstr "Destination directory to write built package files to." - -#: src/hydrilla/builder/build.py:396 -msgid "build_package_from_srcdir_to_dstdir" -msgstr "" -"Build Hydrilla package from `scrdir` and write the resulting files under " -"`dstdir`." - -#: src/hydrilla/util/_util.py:76 -msgid "bad_comment" -msgstr "bad comment" - 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 -- cgit v1.2.3