From a34dae2ad0fe0db769bb08605976b46819af8b11 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 28 Nov 2020 13:49:28 +0100 Subject: [PATCH] Compile messages on setup --- .gitignore | 3 +++ setup.py | 14 ++++++++++++-- .../locale/en/LC_MESSAGES/squirrelbattle.mo | Bin 368 -> 0 bytes .../locale/fr/LC_MESSAGES/squirrelbattle.mo | Bin 2638 -> 0 bytes 4 files changed, 15 insertions(+), 2 deletions(-) delete mode 100644 squirrelbattle/locale/en/LC_MESSAGES/squirrelbattle.mo delete mode 100644 squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.mo diff --git a/.gitignore b/.gitignore index f30aa49..8499d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ save.json # Don't commit docs output docs/_build + +# Don't commit compiled messages +*.mo diff --git a/setup.py b/setup.py index a9b8379..00bd56b 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/squirrelbattle/locale/en/LC_MESSAGES/squirrelbattle.mo b/squirrelbattle/locale/en/LC_MESSAGES/squirrelbattle.mo deleted file mode 100644 index 14164ec0ffb6694d6c55f833f37252bf09f9cc75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmYL^zfQw25Qjl9Wn^aXzy=qnK&Y5Msv&NPWH(isBEjaSCKv^~*e-$x;q`bHE63^1&Ug2-xBIA*gv=7EvO2Yfbc(2=~ zim}z?G##9!gQV1J=Of6_m=)Y^ngEsSUHFqnwO2Nz&Ns=dfKq>$?n}s2)Ra7OR)Q=b zW8}V|GCzDOraTcUM5wy9Rz>G2883t&QzkjN;*#ZJ#Img9^Z5;`w%MpgL#5RlC4x;S z3pPPdh*4|0sl7uYBy-R4x diff --git a/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.mo b/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.mo deleted file mode 100644 index eb2e033a3be0be6f3613020253fa56fa6f3334af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2638 zcmbuA&yQ3^5XW0V)ImYPpNQH^Ld3uuSTTkSC=AR1gEKqp%q(QRn4WpPZyMg~esuR6 z7zzIXCllh$c<|&Hd ze*^Jj|6q6s+=zkp_hejD5a{toU1cVdxv8hjP>;8yTs@C^6`_$YV>+zf7j(X@XnNc#>= z7=pC_1CZpt0^bL}0iOViP|^h(AnCsW!gO|P!tX)+*bf-U-k&DxzkpD|ex1z!03XNv zFYtMAGn};t+zrAVBOOnHFn4q=!Zq?6r4RXa+FrsRPok5LC_i?gPaEl_M(0i&4sNH%A98jHTP{E~2d$z(d@Mswd)jwd3W$<;)^EqUK$JXA6~${NyT*w++2 z46ErnYs3-v8`)=gTYPdz0#3mO_NAE&T(NSPn2_5=5P{BwA{fgzNBKA z&n+&`os@|qSK}fbV{MlDJg;~j8P7u*OE1GbYst$#gT|CX)#^%qrdgjGsp4>jhA3^7 z9lu)hL?^VY(z;k*;KfFnm&(NwYn!Cax>8t=F^pu_L~QJQW<|S=?0_X6yo#h{ zS2Tijm0a)g(@9r($FG<)H5#dOb$Q*33lbkhf*^YA5ec#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