diff --git a/pyproject.toml b/pyproject.toml index 1d45cca96f..f77c2f1510 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ requires = [ "setuptools>=51.0", "sphinx", "wheel", + "trubar>=0.3.3" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 6e65eafd11..83fe1f83cf 100755 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import sys import subprocess from setuptools import setup, find_packages, Command +from setuptools.command.install import install from distutils.command import install_data, sdist from distutils.command.build_ext import build_ext @@ -473,9 +474,25 @@ def ext_modules(): return modules +class InstallMultilingualCommand(install): + def run(self): + super().run() + self.compile_to_multilingual() + + def compile_to_multilingual(self): + from trubar import translate + + package_dir = os.path.dirname(os.path.abspath(__file__)) + translate( + "msgs.jaml", + source_dir=os.path.join(self.install_lib, "Orange"), + config_file=os.path.join(package_dir, "i18n", "trubar-config.yaml")) + + def setup_package(): write_version_py() cmdclass = { + 'install': InstallMultilingualCommand, 'lint': LintCommand, 'coverage': CoverageCommand, 'config': config,