Skip to content

Commit

Permalink
Use Babel.default_locale when getting the fallback locale for list_tr…
Browse files Browse the repository at this point in the history
…anslations (resolves #197)
  • Loading branch information
TkTech committed Jan 15, 2023
1 parent 3dfb45e commit 2a99489
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions flask_babel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def localeselector(self, f):
return f

def timezoneselector(self, f):
"""Registers a callback function for timezone selection. The default
"""Registers a callback function for timezone selection. The default
behaves as if a function was registered that returns `None` all the
time. If `None` is returned, the timezone falls back to the one from
the configuration.
Expand All @@ -134,9 +134,8 @@ def timezoneselector(self, f):
return f

def list_translations(self):
"""Returns a list of all the locales translations exist for. The
list returned will be filled with actual locale objects and not just
strings.
"""Returns a list of all the locales translations exist for. The list
returned will be filled with actual locale objects and not just strings.
.. versionadded:: 0.6
"""
Expand All @@ -156,7 +155,7 @@ def list_translations(self):

# If no other translations are found, add the default locale
if not result:
result.append(Locale.parse(self._default_locale))
result.append(self.default_locale)

return result

Expand Down

0 comments on commit 2a99489

Please sign in to comment.