python3Packages.translation-finder: init at 2.16

This commit is contained in:
Kerstin Humm
2024-08-13 08:44:54 +02:00
committed by Valentin Gagarin
parent 5941b2d362
commit 601d293376
3 changed files with 67 additions and 0 deletions
@@ -0,0 +1,40 @@
{
lib,
buildPythonPackage,
fetchPypi,
charset-normalizer,
ruamel-yaml,
weblate-language-data,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "translation-finder";
version = "2.16";
src = fetchPypi {
pname = "translation-finder";
inherit version;
hash = "sha256-a1C+j4Zo0DJ9BWDn5Zsu4zAftcUixfPktAWdqiFJpiU=";
};
patches = [ ./fix_tests.patch ];
dependencies = [
charset-normalizer
ruamel-yaml
weblate-language-data
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "translation_finder" ];
meta = with lib; {
description = "Translation file finder for Weblate";
homepage = "https://github.com/WeblateOrg/translation-finder";
license = licenses.gpl3Only;
maintainers = with maintainers; [ erictapen ];
};
}
@@ -0,0 +1,25 @@
diff --git a/translation_finder/test_api.py b/translation_finder/test_api.py
index c3b020c..9be070d 100644
--- a/translation_finder/test_api.py
+++ b/translation_finder/test_api.py
@@ -173,6 +173,7 @@ class APITest(DiscoveryTestCase):
"filemask": "json/gotext-*.json",
"template": "json/gotext-en.json",
},
+ {'filemask': 'linked/*.po', 'new_base': 'linked/messages.pot', 'file_format': 'po'},
],
)
diff --git a/translation_finder/test_discovery.py b/translation_finder/test_discovery.py
index 1a0ca40..14caa4f 100644
--- a/translation_finder/test_discovery.py
+++ b/translation_finder/test_discovery.py
@@ -945,6 +945,9 @@ class JSONDiscoveryTest(DiscoveryTestCase):
"file_format": "json-nested",
"template": "src/app/[locale]/_translations/en.json",
},
+ {'filemask': '*/app/[locale]/_translations/cs.json', 'file_format': 'json-nested'},
+ {'filemask': '*/app/[locale]/_translations/de.json', 'file_format': 'json-nested'},
+ {'filemask': '*/app/[locale]/_translations/en.json', 'file_format': 'json-nested'}
],
)
+2
View File
@@ -15813,6 +15813,8 @@ self: super: with self; {
translate-toolkit = callPackage ../development/python-modules/translate-toolkit { };
translation-finder = callPackage ../development/python-modules/translation-finder { };
trackpy = callPackage ../development/python-modules/trackpy { };
trafilatura = callPackage ../development/python-modules/trafilatura { };