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

Allow a different locale separator than underscore #228

Open Sundava opened 1 year ago

Sundava commented 1 year ago

In the get_locale function, the locale is sent to babel for parsing with no optional arguments. This means the call to Locale.parse(rv) (defined here in python-babel) uses the default value of _ as a separator.

However, RFC 5646 which is part of BCP 47 preconises using a hyphen (-) as a separator between the language tag and the subtag.

Is it possible to allow some configuration as to what separator is used in the call to Locale.parse ?