Skip to content

Commit

Permalink
[Mod] generate mo files in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Mar 13, 2024
1 parent 8a70c10 commit b8d6dd8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
import sys
import subprocess
from pathlib import Path
from setuptools import setup


# Generate i18n mo files
python_path: Path = Path(sys.executable)
msgfmt_path: Path = python_path.parent.joinpath("Tools", "i18n", "msgfmt.py")

generate_mo_cmd = [
str(python_path),
str(msgfmt_path),
"-o",
".\\vnpy\\trader\\locale\\en\\LC_MESSAGES\\vnpy.mo",
".\\vnpy\\trader\\locale\\en\\LC_MESSAGES\\vnpy"
]

subprocess.run(generate_mo_cmd)


# Run setup
setup()

0 comments on commit b8d6dd8

Please sign in to comment.