utils.timezone.override()

override(timezone) [source] This is a Python context manager that sets the current time zone on entry with activate(), and restores the previously active time zone on exit. If the timezone argument is None, the current time zone is unset on entry with deactivate() instead. override is also usable as a function decorator.

utils.translation.activate()

activate(language) [source] Fetches the translation object for a given language and activates it as the current translation object for the current thread.

utils.translation.check_for_language()

check_for_language(lang_code) [source] Checks whether there is a global language file for the given language code (e.g. ‘fr’, ‘pt_BR’). This is used to decide whether a user-provided language is available.

utils.translation.deactivate()

deactivate() [source] Deactivates the currently active translation object so that further _ calls will resolve against the default translation object, again.

utils.translation.deactivate_all()

deactivate_all() [source] Makes the active translation object a NullTranslations() instance. This is useful when we want delayed translations to appear as the original string for some reason.

utils.translation.gettext()

gettext(message) [source] Translates message and returns it in a UTF-8 bytestring

utils.translation.gettext_lazy()

gettext_lazy(message)

utils.translation.gettext_noop()

gettext_noop(message) [source]

utils.translation.get_language()

get_language() [source] Returns the currently selected language code. Returns None if translations are temporarily deactivated (by deactivate_all() or when None is passed to override()).

utils.translation.get_language_bidi()

get_language_bidi() [source] Returns selected language’s BiDi layout: False = left-to-right layout True = right-to-left layout