Skip to content

Commit 30b354e

Browse files
authored
Merge pull request #17 from aarranz/fix/missing-translations
Fix missing translations on the dev image
2 parents 8eef076 + b537d09 commit 30b354e

5 files changed

Lines changed: 36 additions & 1 deletion

File tree

1.0-composable/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ def test_should_serve_static_files(self):
5656
response = requests.get("http://localhost/static/theme/wirecloud.defaulttheme/images/logos/header.png")
5757
self.assertEqual(response.status_code, 200)
5858

59+
def test_should_serve_translations(self):
60+
response = requests.get("http://localhost/api/i18n/js_catalogue?language=es")
61+
self.assertEqual(response.status_code, 200)
62+
# Look for basic translations
63+
self.assertIn('"Yes"', response.text)
64+
self.assertIn('"No"', response.text)
65+
self.assertIn('"Warning"', response.text)
66+
5967

6068
if __name__ == "__main__":
6169
unittest.main(verbosity=2)

1.1-composable/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ def test_should_serve_static_files(self):
5656
response = requests.get("http://localhost/static/theme/wirecloud.defaulttheme/images/logos/header.png")
5757
self.assertEqual(response.status_code, 200)
5858

59+
def test_should_serve_translations(self):
60+
response = requests.get("http://localhost/api/i18n/js_catalogue?language=es")
61+
self.assertEqual(response.status_code, 200)
62+
# Look for basic translations
63+
self.assertIn('"Yes"', response.text)
64+
self.assertIn('"No"', response.text)
65+
self.assertIn('"Warning"', response.text)
66+
5967

6068
if __name__ == "__main__":
6169
unittest.main(verbosity=2)

1.2/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ def test_should_serve_static_files(self):
3535
response = requests.get("http://localhost/static/theme/wirecloud.defaulttheme/images/logos/header.png")
3636
self.assertEqual(response.status_code, 200)
3737

38+
def test_should_serve_translations(self):
39+
response = requests.get("http://localhost/api/i18n/js_catalogue?language=es")
40+
self.assertEqual(response.status_code, 200)
41+
# Look for basic translations
42+
self.assertIn('"Yes"', response.text)
43+
self.assertIn('"No"', response.text)
44+
self.assertIn('"Warning"', response.text)
45+
3846

3947
class StandaloneTests(unittest.TestCase, WireCloudTests):
4048

dev/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ RUN apt-get update && \
2929

3030
# Install WireCloud & dependencies
3131
RUN git clone --depth=1 https://github.com/Wirecloud/wirecloud.git && \
32+
apt-get update && apt-get install -y gettext && \
3233
pip install "django<=1.11" && \
3334
cd wirecloud/src && \
3435
python setup.py bdist_wheel && \
3536
pip install --no-cache-dir dist/*.whl && \
3637
cd ../.. && \
37-
rm -rf wirecloud
38+
rm -rf wirecloud && \
39+
apt-get remove -y gettext && \
40+
rm -rf /var/lib/apt/lists/*
3841

3942
COPY ./docker-entrypoint.sh /
4043
COPY ./manage.py /usr/local/bin/

dev/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ def test_should_serve_static_files(self):
3535
response = requests.get("http://localhost/static/theme/wirecloud.defaulttheme/images/logos/header.png")
3636
self.assertEqual(response.status_code, 200)
3737

38+
def test_should_serve_translations(self):
39+
response = requests.get("http://localhost/api/i18n/js_catalogue?language=es")
40+
self.assertEqual(response.status_code, 200)
41+
# Look for basic translations
42+
self.assertIn('"Yes"', response.text)
43+
self.assertIn('"No"', response.text)
44+
self.assertIn('"Warning"', response.text)
45+
3846

3947
class StandaloneTests(unittest.TestCase, WireCloudTests):
4048

0 commit comments

Comments
 (0)