We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix translations in package
The compilemessages step for geotrek and mapentity is missing somewhere

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/python3
2 import os
3 import distutils.command.build
4 from setuptools import setup, find_packages
5 
6 here = os.path.abspath(os.path.dirname(__file__))
7 
8 
9 class BuildCommand(distutils.command.build.build):
10     def run(self):
11         print("before")
12         distutils.command.build.build.run(self)
13         print("after")
14         from django.core.management import call_command
15         curdir = os.getcwd()
16         os.chdir(os.path.join(curdir, 'geotrek'))
17         call_command('compilemessages')
18         os.chdir(os.path.join(curdir, 'mapentity'))
19         call_command('compilemessages')
20         os.chdir(curdir)
21 
22 
23 setup(
24     name='geotrek',
25     version=open(os.path.join(here, 'VERSION')).read().strip(),
26     author='Makina Corpus',
27     author_email='geobi@makina-corpus.com',
28     url='http://makina-corpus.com',
29     description="Geotrek",
30     long_description=(open(os.path.join(here, 'README.rst')).read() + '\n\n'
31                       + open(os.path.join(here, 'docs', 'changelog.rst')).read()),
32     scripts=['manage.py'],
33     install_requires=[
34         # pinned by requirements.txt
35         'psycopg2',
36         'docutils',
37         'GDAL',
38         'Pillow',
39         'easy-thumbnails',
40         'simplekml',
41         'pygal',
42         'django-extended-choices',
43         'django-multiselectfield',
44         'geojson',
45         'tif2geojson',
46         'pytz',
47         'djangorestframework-gis',
48         'drf-dynamic-fields',
49         'django-rest-swagger',
50         'django-embed-video',
51         'xlrd',
52         'landez',
53         'redis',
54         'celery',
55         'django-celery-results',
56         'requests[security]',
57         'drf-extensions',
58         'django-colorfield',
59         'factory_boy',
60     ],
61     cmdclass={"build": BuildCommand},
62     include_package_data=True,
63     license='BSD, see LICENSE file.',
64     packages=find_packages(),
65     classifiers=['Natural Language :: English',
66                  'Environment :: Web Environment',
67                  'Framework :: Django',
68                  'Development Status :: 5 - Production/Stable',
69                  'Programming Language :: Python :: 2.7'],
70 )
71
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,23 +1,24 @@
 #!/usr/bin/python3
 import os
 import distutils.command.build
+from pathlib import Path
 from setuptools import setup, find_packages
+from shutil import copy
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 
 class BuildCommand(distutils.command.build.build):
     def run(self):
-        print("before")
         distutils.command.build.build.run(self)
-        print("after")
         from django.core.management import call_command
         curdir = os.getcwd()
-        os.chdir(os.path.join(curdir, 'geotrek'))
-        call_command('compilemessages')
-        os.chdir(os.path.join(curdir, 'mapentity'))
-        call_command('compilemessages')
-        os.chdir(curdir)
+        for subdir in ('geotrek', 'mapentity'):
+            os.chdir(subdir)
+            call_command('compilemessages')
+            for path in Path('.').rglob('*.mo'):
+                copy(path, os.path.join(curdir, self.build_lib, subdir, path))
+            os.chdir(curdir)
 
 
 setup(

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,23 +1,24 @@\n #!/usr/bin/python3\n import os\n import distutils.command.build\n+from pathlib import Path\n from setuptools import setup, find_packages\n+from shutil import copy\n \n here = os.path.abspath(os.path.dirname(__file__))\n \n \n class BuildCommand(distutils.command.build.build):\n     def run(self):\n-        print(\"before\")\n         distutils.command.build.build.run(self)\n-        print(\"after\")\n         from django.core.management import call_command\n         curdir = os.getcwd()\n-        os.chdir(os.path.join(curdir, 'geotrek'))\n-        call_command('compilemessages')\n-        os.chdir(os.path.join(curdir, 'mapentity'))\n-        call_command('compilemessages')\n-        os.chdir(curdir)\n+        for subdir in ('geotrek', 'mapentity'):\n+            os.chdir(subdir)\n+            call_command('compilemessages')\n+            for path in Path('.').rglob('*.mo'):\n+                copy(path, os.path.join(curdir, self.build_lib, subdir, path))\n+            os.chdir(curdir)\n \n \n setup(\n", "issue": "Fix translations in package\nThe compilemessages step for geotrek and mapentity is missing somewhere\n", "before_files": [{"content": "#!/usr/bin/python3\nimport os\nimport distutils.command.build\nfrom setuptools import setup, find_packages\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\nclass BuildCommand(distutils.command.build.build):\n    def run(self):\n        print(\"before\")\n        distutils.command.build.build.run(self)\n        print(\"after\")\n        from django.core.management import call_command\n        curdir = os.getcwd()\n        os.chdir(os.path.join(curdir, 'geotrek'))\n        call_command('compilemessages')\n        os.chdir(os.path.join(curdir, 'mapentity'))\n        call_command('compilemessages')\n        os.chdir(curdir)\n\n\nsetup(\n    name='geotrek',\n    version=open(os.path.join(here, 'VERSION')).read().strip(),\n    author='Makina Corpus',\n    author_email='geobi@makina-corpus.com',\n    url='http://makina-corpus.com',\n    description=\"Geotrek\",\n    long_description=(open(os.path.join(here, 'README.rst')).read() + '\\n\\n'\n                      + open(os.path.join(here, 'docs', 'changelog.rst')).read()),\n    scripts=['manage.py'],\n    install_requires=[\n        # pinned by requirements.txt\n        'psycopg2',\n        'docutils',\n        'GDAL',\n        'Pillow',\n        'easy-thumbnails',\n        'simplekml',\n        'pygal',\n        'django-extended-choices',\n        'django-multiselectfield',\n        'geojson',\n        'tif2geojson',\n        'pytz',\n        'djangorestframework-gis',\n        'drf-dynamic-fields',\n        'django-rest-swagger',\n        'django-embed-video',\n        'xlrd',\n        'landez',\n        'redis',\n        'celery',\n        'django-celery-results',\n        'requests[security]',\n        'drf-extensions',\n        'django-colorfield',\n        'factory_boy',\n    ],\n    cmdclass={\"build\": BuildCommand},\n    include_package_data=True,\n    license='BSD, see LICENSE file.',\n    packages=find_packages(),\n    classifiers=['Natural Language :: English',\n                 'Environment :: Web Environment',\n                 'Framework :: Django',\n                 'Development Status :: 5 - Production/Stable',\n                 'Programming Language :: Python :: 2.7'],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/python3\nimport os\nimport distutils.command.build\nfrom pathlib import Path\nfrom setuptools import setup, find_packages\nfrom shutil import copy\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\nclass BuildCommand(distutils.command.build.build):\n    def run(self):\n        distutils.command.build.build.run(self)\n        from django.core.management import call_command\n        curdir = os.getcwd()\n        for subdir in ('geotrek', 'mapentity'):\n            os.chdir(subdir)\n            call_command('compilemessages')\n            for path in Path('.').rglob('*.mo'):\n                copy(path, os.path.join(curdir, self.build_lib, subdir, path))\n            os.chdir(curdir)\n\n\nsetup(\n    name='geotrek',\n    version=open(os.path.join(here, 'VERSION')).read().strip(),\n    author='Makina Corpus',\n    author_email='geobi@makina-corpus.com',\n    url='http://makina-corpus.com',\n    description=\"Geotrek\",\n    long_description=(open(os.path.join(here, 'README.rst')).read() + '\\n\\n'\n                      + open(os.path.join(here, 'docs', 'changelog.rst')).read()),\n    scripts=['manage.py'],\n    install_requires=[\n        # pinned by requirements.txt\n        'psycopg2',\n        'docutils',\n        'GDAL',\n        'Pillow',\n        'easy-thumbnails',\n        'simplekml',\n        'pygal',\n        'django-extended-choices',\n        'django-multiselectfield',\n        'geojson',\n        'tif2geojson',\n        'pytz',\n        'djangorestframework-gis',\n        'drf-dynamic-fields',\n        'django-rest-swagger',\n        'django-embed-video',\n        'xlrd',\n        'landez',\n        'redis',\n        'celery',\n        'django-celery-results',\n        'requests[security]',\n        'drf-extensions',\n        'django-colorfield',\n        'factory_boy',\n    ],\n    cmdclass={\"build\": BuildCommand},\n    include_package_data=True,\n    license='BSD, see LICENSE file.',\n    packages=find_packages(),\n    classifiers=['Natural Language :: English',\n                 'Environment :: Web Environment',\n                 'Framework :: Django',\n                 'Development Status :: 5 - Production/Stable',\n                 'Programming Language :: Python :: 2.7'],\n)\n", "path": "setup.py"}]}