uncomment internationalizion step of setup.py build process
This commit is contained in:
parent
36476e6750
commit
aa1a2a476f
22
setup.py
22
setup.py
|
@ -1,4 +1,6 @@
|
|||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
|
||||
import Cython.Build
|
||||
import numpy
|
||||
|
@ -30,20 +32,18 @@ class build_py(_build_py):
|
|||
"""Command to compile translation message catalogs before building."""
|
||||
|
||||
def run(self):
|
||||
# NOTE: un-comment this when we get message catalogs.
|
||||
#
|
||||
# internationalization: compile human-readable PO message catalogs
|
||||
# into machine-readable MO message catalogs used by gettext
|
||||
# the MO files are included as package data
|
||||
# locale_dir = os.path.abspath(os.path.join(
|
||||
# os.path.dirname(__file__),
|
||||
# 'src/natcap/invest/internationalization/locales'))
|
||||
# for locale in os.listdir(locale_dir):
|
||||
# subprocess.run([
|
||||
# 'pybabel',
|
||||
# 'compile',
|
||||
# '--input-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.po',
|
||||
# '--output-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.mo'])
|
||||
locale_dir = os.path.abspath(os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'src/natcap/invest/internationalization/locales'))
|
||||
for locale in ['es']:
|
||||
subprocess.run([
|
||||
'pybabel',
|
||||
'compile',
|
||||
'--input-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.po',
|
||||
'--output-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.mo'])
|
||||
# then execute the original run method
|
||||
_build_py.run(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue