Only print missing polib message during build as a warning

This commit is contained in:
Chris Mayo 2021-12-30 19:27:04 +00:00
parent 3aad37b86e
commit 2f40fe8415

View file

@ -41,7 +41,6 @@ from setuptools.command.sdist import sdist
try:
import polib
except ImportError:
print("polib package not found. Translations not compiled.")
COMPILE_TRANSLATIONS = False
else:
COMPILE_TRANSLATIONS = True
@ -101,6 +100,10 @@ class MyBuild(build):
pofile = polib.pofile(str(po))
mo.parent.mkdir(exist_ok=True, parents=True)
pofile.save_as_mofile(str(mo))
else:
print(
"warning: polib package not found: translations not compiled",
file=sys.stderr)
super().run()