diff --git a/Makefile b/Makefile index db3fab002..b5ab4897b 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ languages-po/%.po: modules/cldr-json/cldr-json/cldr-localenames-full/main/en/lan l10n-guide.csv: modules/l10n-guide/docs/l10n/pluralforms.rst scripts/export-l10n-guide.py ./scripts/export-l10n-guide.py -LANG_DATA = $(shell python -c 'from pkg_resources import Requirement, resource_filename; print(resource_filename(Requirement.parse("translate-toolkit"), "translate/lang/data.py"))') +LANG_DATA = $(shell python ./scripts/get-lang-data-path.py) translate.csv: $(LANG_DATA) scripts/export-translate.py ./scripts/export-translate.py diff --git a/scripts/get-lang-data-path.py b/scripts/get-lang-data-path.py new file mode 100755 index 000000000..95e70d375 --- /dev/null +++ b/scripts/get-lang-data-path.py @@ -0,0 +1,11 @@ +#! /usr/bin/env python3 + +# Copyright © Michal Čihař +# +# SPDX-License-Identifier: MIT + +from importlib.resources import as_file, files + +ref = files("translate") / "lang" / "data.py" +with as_file(ref) as path: + print(path)