Revision 0fe371da
Added by koszko over 1 year ago
| .gitignore | ||
|---|---|---|
| 10 | 10 |
*.pyc |
| 11 | 11 |
setuptools |
| 12 | 12 |
src/hydrilla/builder/_version.py |
| 13 |
src/hydrilla/builder/locales/messages.pot |
|
| 14 |
messages.mo |
|
| 13 |
src/hydrilla/builder/locales/hydrilla-messages.pot |
|
| 14 |
hydrilla-messages.mo |
|
| MANIFEST.in | ||
|---|---|---|
| 5 | 5 |
# Available under the terms of Creative Commons Zero v1.0 Universal. |
| 6 | 6 |
|
| 7 | 7 |
include src/hydrilla/schemas/*.schema.json* |
| 8 |
include src/hydrilla/builder/locales/*/LC_MESSAGES/messages.po |
|
| 8 |
include src/hydrilla/builder/locales/*/LC_MESSAGES/hydrilla-messages.po
|
|
| 9 | 9 |
include src/test/source-package-example/* |
| 10 | 10 |
global-exclude .git .gitignore .gitmodules |
| setup.cfg | ||
|---|---|---|
| 40 | 40 |
# reuse |
| 41 | 41 |
|
| 42 | 42 |
[options.package_data] |
| 43 |
hydrilla.builder = locales/*/LC_MESSAGES/messages.mo |
|
| 43 |
hydrilla.builder = locales/*/LC_MESSAGES/hydrilla-messages.mo
|
|
| 44 | 44 |
|
| 45 | 45 |
[options.extras_require] |
| 46 | 46 |
test = pytest |
| ... | ... | |
| 59 | 59 |
keywords = _ |
| 60 | 60 |
width = 80 |
| 61 | 61 |
input_dirs = src/hydrilla |
| 62 |
output_file = src/hydrilla/builder/locales/messages.pot |
|
| 62 |
output_file = src/hydrilla/builder/locales/hydrilla-messages.pot
|
|
| 63 | 63 |
msgid_bugs_address = koszko@koszko.org |
| 64 | 64 |
sort_by_file = True |
| 65 | 65 |
copyright_holder = Wojtek Kosior <koszko@koszko.org> |
| 66 | 66 |
|
| 67 | 67 |
[init_catalog] |
| 68 |
input_file = src/hydrilla/builder/locales/messages.pot |
|
| 68 |
input_file = src/hydrilla/builder/locales/hydrilla-messages.pot
|
|
| 69 | 69 |
output_dir = src/hydrilla/builder/locales/ |
| 70 |
domain = messages |
|
| 70 |
domain = hydrilla-messages
|
|
| 71 | 71 |
|
| 72 | 72 |
[update_catalog] |
| 73 |
input_file = src/hydrilla/builder/locales/messages.pot |
|
| 73 |
input_file = src/hydrilla/builder/locales/hydrilla-messages.pot
|
|
| 74 | 74 |
output_dir = src/hydrilla/builder/locales/ |
| 75 |
domain = messages |
|
| 75 |
domain = hydrilla-messages
|
|
| 76 | 76 |
|
| 77 | 77 |
[compile_catalog] |
| 78 | 78 |
directory = src/hydrilla/builder/locales |
| 79 | 79 |
use_fuzzy = True |
| 80 |
domain = messages |
|
| 80 |
domain = hydrilla-messages |
|
| src/hydrilla/builder/locales/en_US/LC_MESSAGES/hydrilla-messages.po | ||
|---|---|---|
| 1 |
# SPDX-License-Identifier: CC0-1.0 |
|
| 2 |
# |
|
| 3 |
# English (United States) translations for hydrilla.builder. |
|
| 4 |
# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org> |
|
| 5 |
# Available under the terms of Creative Commons Zero v1.0 Universal. |
|
| 6 |
msgid "" |
|
| 7 |
msgstr "" |
|
| 8 |
"Project-Id-Version: hydrilla.builder 0.1.dev16+g4e46d7f.d20220211\n" |
|
| 9 |
"Report-Msgid-Bugs-To: koszko@koszko.org\n" |
|
| 10 |
"POT-Creation-Date: 2022-02-12 14:40+0100\n" |
|
| 11 |
"PO-Revision-Date: 2022-02-12 00:00+0000\n" |
|
| 12 |
"Last-Translator: Wojtek Kosior <koszko@koszko.org>\n" |
|
| 13 |
"Language: en_US\n" |
|
| 14 |
"Language-Team: en_US <koszko@koszko.org>\n" |
|
| 15 |
"Plural-Forms: nplurals=2; plural=(n != 1)\n" |
|
| 16 |
"MIME-Version: 1.0\n" |
|
| 17 |
"Content-Type: text/plain; charset=utf-8\n" |
|
| 18 |
"Content-Transfer-Encoding: 8bit\n" |
|
| 19 |
"Generated-By: Babel 2.8.0\n" |
|
| 20 |
|
|
| 21 |
#: src/hydrilla/builder/build.py:107 |
|
| 22 |
msgid "couldnt_import_reuse_is_it_installed" |
|
| 23 |
msgstr "" |
|
| 24 |
"Could not import 'reuse'. Is the tool installed and visible to this " |
|
| 25 |
"Python instance?" |
|
| 26 |
|
|
| 27 |
#: src/hydrilla/builder/build.py:112 |
|
| 28 |
msgid "spdx_report_from_reuse_incompliant" |
|
| 29 |
msgstr "Attempt to generate an SPDX report for a REUSE-incompliant package." |
|
| 30 |
|
|
| 31 |
#: src/hydrilla/builder/build.py:196 |
|
| 32 |
msgid "loading_{}_outside_package_dir"
|
|
| 33 |
msgstr "Attempt to load '{}' which lies outside package source directory."
|
|
| 34 |
|
|
| 35 |
#: src/hydrilla/builder/build.py:200 |
|
| 36 |
msgid "loading_reserved_index_json" |
|
| 37 |
msgstr "Attempt to load 'index.json' which is a reserved filename." |
|
| 38 |
|
|
| 39 |
#: src/hydrilla/builder/build.py:314 |
|
| 40 |
msgid "report_spdx_not_in_copyright_list" |
|
| 41 |
msgstr "" |
|
| 42 |
"Told to generate 'report.spdx' but 'report.spdx' is not listed among " |
|
| 43 |
"copyright files. Refusing to proceed." |
|
| 44 |
|
|
| 45 |
#: src/hydrilla/builder/build.py:386 |
|
| 46 |
msgid "source_directory_to_build_from" |
|
| 47 |
msgstr "Source directory to build from." |
|
| 48 |
|
|
| 49 |
#: src/hydrilla/builder/build.py:388 |
|
| 50 |
msgid "path_instead_of_index_json" |
|
| 51 |
msgstr "" |
|
| 52 |
"Path to file to be processed instead of index.json (if not absolute, " |
|
| 53 |
"resolved relative to srcdir)." |
|
| 54 |
|
|
| 55 |
#: src/hydrilla/builder/build.py:390 |
|
| 56 |
msgid "built_package_files_destination" |
|
| 57 |
msgstr "Destination directory to write built package files to." |
|
| 58 |
|
|
| 59 |
#: src/hydrilla/builder/build.py:396 |
|
| 60 |
msgid "build_package_from_srcdir_to_dstdir" |
|
| 61 |
msgstr "" |
|
| 62 |
"Build Hydrilla package from `scrdir` and write the resulting files under " |
|
| 63 |
"`dstdir`." |
|
| 64 |
|
|
| 65 |
#: src/hydrilla/util/_util.py:76 |
|
| 66 |
msgid "bad_comment" |
|
| 67 |
msgstr "bad comment" |
|
| 68 |
|
|
| src/hydrilla/builder/locales/en_US/LC_MESSAGES/messages.po | ||
|---|---|---|
| 1 |
# SPDX-License-Identifier: CC0-1.0 |
|
| 2 |
# |
|
| 3 |
# English (United States) translations for hydrilla.builder. |
|
| 4 |
# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org> |
|
| 5 |
# Available under the terms of Creative Commons Zero v1.0 Universal. |
|
| 6 |
msgid "" |
|
| 7 |
msgstr "" |
|
| 8 |
"Project-Id-Version: hydrilla.builder 0.1.dev16+g4e46d7f.d20220211\n" |
|
| 9 |
"Report-Msgid-Bugs-To: koszko@koszko.org\n" |
|
| 10 |
"POT-Creation-Date: 2022-02-12 14:40+0100\n" |
|
| 11 |
"PO-Revision-Date: 2022-02-12 00:00+0000\n" |
|
| 12 |
"Last-Translator: Wojtek Kosior <koszko@koszko.org>\n" |
|
| 13 |
"Language: en_US\n" |
|
| 14 |
"Language-Team: en_US <koszko@koszko.org>\n" |
|
| 15 |
"Plural-Forms: nplurals=2; plural=(n != 1)\n" |
|
| 16 |
"MIME-Version: 1.0\n" |
|
| 17 |
"Content-Type: text/plain; charset=utf-8\n" |
|
| 18 |
"Content-Transfer-Encoding: 8bit\n" |
|
| 19 |
"Generated-By: Babel 2.8.0\n" |
|
| 20 |
|
|
| 21 |
#: src/hydrilla/builder/build.py:107 |
|
| 22 |
msgid "couldnt_import_reuse_is_it_installed" |
|
| 23 |
msgstr "" |
|
| 24 |
"Could not import 'reuse'. Is the tool installed and visible to this " |
|
| 25 |
"Python instance?" |
|
| 26 |
|
|
| 27 |
#: src/hydrilla/builder/build.py:112 |
|
| 28 |
msgid "spdx_report_from_reuse_incompliant" |
|
| 29 |
msgstr "Attempt to generate an SPDX report for a REUSE-incompliant package." |
|
| 30 |
|
|
| 31 |
#: src/hydrilla/builder/build.py:196 |
|
| 32 |
msgid "loading_{}_outside_package_dir"
|
|
| 33 |
msgstr "Attempt to load '{}' which lies outside package source directory."
|
|
| 34 |
|
|
| 35 |
#: src/hydrilla/builder/build.py:200 |
|
| 36 |
msgid "loading_reserved_index_json" |
|
| 37 |
msgstr "Attempt to load 'index.json' which is a reserved filename." |
|
| 38 |
|
|
| 39 |
#: src/hydrilla/builder/build.py:314 |
|
| 40 |
msgid "report_spdx_not_in_copyright_list" |
|
| 41 |
msgstr "" |
|
| 42 |
"Told to generate 'report.spdx' but 'report.spdx' is not listed among " |
|
| 43 |
"copyright files. Refusing to proceed." |
|
| 44 |
|
|
| 45 |
#: src/hydrilla/builder/build.py:386 |
|
| 46 |
msgid "source_directory_to_build_from" |
|
| 47 |
msgstr "Source directory to build from." |
|
| 48 |
|
|
| 49 |
#: src/hydrilla/builder/build.py:388 |
|
| 50 |
msgid "path_instead_of_index_json" |
|
| 51 |
msgstr "" |
|
| 52 |
"Path to file to be processed instead of index.json (if not absolute, " |
|
| 53 |
"resolved relative to srcdir)." |
|
| 54 |
|
|
| 55 |
#: src/hydrilla/builder/build.py:390 |
|
| 56 |
msgid "built_package_files_destination" |
|
| 57 |
msgstr "Destination directory to write built package files to." |
|
| 58 |
|
|
| 59 |
#: src/hydrilla/builder/build.py:396 |
|
| 60 |
msgid "build_package_from_srcdir_to_dstdir" |
|
| 61 |
msgstr "" |
|
| 62 |
"Build Hydrilla package from `scrdir` and write the resulting files under " |
|
| 63 |
"`dstdir`." |
|
| 64 |
|
|
| 65 |
#: src/hydrilla/util/_util.py:76 |
|
| 66 |
msgid "bad_comment" |
|
| 67 |
msgstr "bad comment" |
|
| 68 |
|
|
| src/hydrilla/util/_util.py | ||
|---|---|---|
| 136 | 136 |
def translation(localedir: Union[Path, str], lang: Optional[str]=None) \ |
| 137 | 137 |
-> gettext.GNUTranslations: |
| 138 | 138 |
""" |
| 139 |
Configure translations for domain 'messages' and return the object that
|
|
| 140 |
represents them. |
|
| 139 |
Configure translations for domain 'hydrilla-messages' and return the object
|
|
| 140 |
that represents them.
|
|
| 141 | 141 |
|
| 142 | 142 |
If `lang` is set, look for translations for `lang`. Otherwise, try to |
| 143 | 143 |
determine system's default language and use that. |
| ... | ... | |
| 151 | 151 |
except: |
| 152 | 152 |
lang = locale.getdefaultlocale()[0] or 'C' |
| 153 | 153 |
|
| 154 |
return gettext.translation('messages', localedir=localedir,
|
|
| 154 |
return gettext.translation('hydrilla-messages', localedir=localedir,
|
|
| 155 | 155 |
languages=[lang, 'en_US']) |
| 156 | 156 |
|
| 157 | 157 |
_ = translation(here.parent / 'builder' / 'locales').gettext |
Also available in: Unified diff
change translation domain to 'hydrilla-messages'