utils.translation.ngettext_lazy()

ngettext_lazy(singular, plural, number) [source]

utils.translation.ngettext()

ngettext(singular, plural, number) [source] Translates singular and plural and returns the appropriate string based on number in a UTF-8 bytestring.

utils.translation.get_language_info()

get_language_info() [source] The get_language_info() function provides detailed information about languages: >>> from django.utils.translation import activate, get_language_info >>> activate('fr') >>> li = get_language_info('de') >>> print(li['name'], li['name_local'], li['name_translated'], li['bidi']) German Deutsch Allemand False The name, name_local, and name_translated attributes of the dictionary contain the name of the language in English, in the l

utils.translation.get_language_from_request()

get_language_from_request(request, check_path=False) [source] Analyzes the request to find what language the user wants the system to show. Only languages listed in settings.LANGUAGES are taken into account. If the user requests a sublanguage where we have a main language, we send out the main language. If check_path is True, the function first checks the requested URL for whether its path begins with a language code listed in the LANGUAGES setting.

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

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.gettext_noop()

gettext_noop(message) [source]

utils.translation.gettext_lazy()

gettext_lazy(message)

utils.translation.gettext()

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

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.