Skip to content

Commit c45c240

Browse files
committed
Ensure compiled translation .mo files are picked up during build phase
There was a bug where simply running `./setup.py install` from a fresh checkout would compile the .po files into .mo files but wouldn't copy them to the `build/` subdirectory. Running `build` then `install` (or running `install` twice) would fix that issue as the files compiled by the first pass would get picked up at the second one. This issue didn't affect the `develop` mode, since there the "installed" package is just a symlink to the source tree, where these files exist.
1 parent 3b46531 commit c45c240

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def find_version():
117117
class build_py_and_l10n(build_py):
118118
def run(self):
119119
self.run_command("compile_catalog")
120+
# The build command of distutils/setuptools searches the tree
121+
# and compiles a list of data files before run() is called and
122+
# then stores that value. Hence we need to refresh it.
123+
self.data_files = self._get_data_files()
120124
# Can't use super here as in Py2 it isn't a new-style class.
121125
build_py.run(self)
122126

0 commit comments

Comments
 (0)