Skip to content

Commit c13e80b

Browse files
authored
fix i18n (pinterest#375)
* fix i18n * Ignore linter error regarding _
1 parent 5745dd4 commit c13e80b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ WORKDIR $APP_DIR
1111
COPY ["setup.py", "requirements.txt", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"]
1212
COPY ["./snappass", "$APP_DIR/snappass"]
1313

14+
RUN pip install -r requirements.txt
15+
16+
RUN pybabel compile -d snappass/translations
17+
1418
RUN python setup.py install && \
1519
chown -R snappass $APP_DIR && \
1620
chgrp -R snappass $APP_DIR
17-
RUN pip install -r requirements.txt
1821

1922
USER snappass
2023

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include *.rst LICENSE
22
recursive-include snappass/static *
33
recursive-include snappass/templates *
4+
recursive-include snappass/translations *

snappass/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from urllib.parse import unquote_plus
1212
from urllib.parse import urljoin
1313
from distutils.util import strtobool
14-
from flask_babel import Babel
14+
# _ is required to get the Jinja templates translated
15+
from flask_babel import Babel, _ # noqa: F401
1516

1617
NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False')))
1718
URL_PREFIX = os.environ.get('URL_PREFIX', None)

0 commit comments

Comments
 (0)