diff --git a/Dockerfile b/Dockerfile index 70e18c5..871a0ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,13 @@ WORKDIR $APP_DIR COPY ["setup.py", "requirements.txt", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"] COPY ["./snappass", "$APP_DIR/snappass"] +RUN pip install -r requirements.txt + +RUN pybabel compile -d snappass/translations + RUN python setup.py install && \ chown -R snappass $APP_DIR && \ chgrp -R snappass $APP_DIR -RUN pip install -r requirements.txt USER snappass diff --git a/MANIFEST.in b/MANIFEST.in index ec67e98..e919377 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include *.rst LICENSE recursive-include snappass/static * recursive-include snappass/templates * +recursive-include snappass/translations * diff --git a/snappass/main.py b/snappass/main.py index 2c16cdc..09867e4 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -11,7 +11,8 @@ from urllib.parse import quote_plus from urllib.parse import unquote_plus from urllib.parse import urljoin from distutils.util import strtobool -from flask_babel import Babel +# _ is required to get the Jinja templates translated +from flask_babel import Babel, _ # noqa: F401 NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False'))) URL_PREFIX = os.environ.get('URL_PREFIX', None)