python-babel / flask-babel

i18n and l10n support for Flask based on Babel and pytz
https://python-babel.github.io/flask-babel/
Other
432 stars 159 forks source link

Error: list_translations does not return config dependent default translation. #197

Closed born2discover closed 1 year ago

born2discover commented 2 years ago

Greetings,

I've recently stumbled upon a peculiar behavior of Flask-Babel that I believe being an error (unless of course I am missing something).

As the title says, the list_translations method does not return a config aware default translation (that is, when no translations are available). Instead, the default case (handled at lines 158-159) returns a Locale instance based on _default_locale.

That contrasts with the way the topic is handled in default_locale, default_timezone and domain properties that all return config aware values.

Considering that default values for the configuration are set to the values of private properties (in init_app, including BABEL_DEFAULT_LOCALE that derives its default value from _default_locale) shouldn't list_translations return config aware value instead?