File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
translations/fr/LC_MESSAGES Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11"""
2- flaskext.babel
3- ~~~~~~~~~~~~~~
2+ flask_babel
3+ ~~~~~~~~~~~
44
55 Implements i18n/l10n support for Flask applications based on Babel.
66
@@ -151,7 +151,7 @@ def list_translations(self):
151151 if not os .path .isdir (locale_dir ):
152152 continue
153153
154- if filter ( lambda x : x .endswith ('.mo' ), os .listdir (locale_dir )):
154+ if any ( x .endswith ('.mo' ) for x in os .listdir (locale_dir )):
155155 result .append (Locale .parse (folder ))
156156
157157 # If not other translations are found, add the default locale.
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ def test_no_request_context():
2222def test_multiple_directories ():
2323 """
2424 Ensure we can load translations from multiple directories.
25+
26+ This also ensures that directories without any translation files
27+ are not taken into account.
2528 """
2629 b = babel .Babel ()
2730 app = flask .Flask (__name__ )
You can’t perform that action at this time.
0 commit comments