Compile messages on setup

This commit is contained in:
Yohann D'ANELLO 2020-11-28 13:49:28 +01:00
parent 5ce62c15f7
commit a34dae2ad0
4 changed files with 15 additions and 2 deletions

3
.gitignore vendored
View File

@ -23,3 +23,6 @@ save.json
# Don't commit docs output
docs/_build
# Don't commit compiled messages
*.mo

View File

@ -3,13 +3,23 @@
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import subprocess
from setuptools import find_packages, setup
with open("README.md", "r") as f:
long_description = f.read()
# Compile messages
for language in ["en", "fr"]:
args = ["msgfmt", "--check-format",
"-o", f"squirrelbattle/locale/{language}/LC_MESSAGES"
"/squirrelbattle.mo",
f"squirrelbattle/locale/{language}/LC_MESSAGES"
"/squirrelbattle.po"]
print(f"Compiling {language} messages...")
subprocess.Popen(args)
setup(
name="squirrel-battle",
version="3.14.1",
@ -36,7 +46,7 @@ setup(
],
python_requires='>=3.6',
include_package_data=True,
package_data={"squirrelbattle": ["assets/*", "locale/*"]},
package_data={"squirrelbattle": ["assets/*", "locale/*/*/*"]},
entry_points={
"console_scripts": [
"squirrel-battle = squirrelbattle.bootstrap:Bootstrap.run_game",