Closed amadanmath closed 1 year ago
Sorry, I sent this prematurely. I have rethought a bit and updated accordingly.
This can be done by using force_locale
, see https://github.com/python-babel/flask-babel/blob/38145eeaf1cd37fa22d95e889ec66eade02e50fd/flask_babel/__init__.py#L279-L279
So far, flask_babel supports translation to the locale selected for the request. If one needs a translation into a different locale, one would need to replicate parts of flask_babel's code. A use case for this is, for example, sending an email to a site administrator in the admininistrator's language.