Most of the time, using Babel's gettext()
or _()
is with a current locale set within the current context, so that the target language is implicit, it is not passed as an argument to gettext().
However, is there a way to get the translation of a phrase in a given target language, such as:
message = gettext('Hello there', language='es')
The original gettext does not have this possibility, but is there any other API that would achieve this ?