Constant | CONTEXT_SEPARATOR |
Undocumented |
Variable | accept_language_re |
Undocumented |
Variable | language_code_prefix_re |
Undocumented |
Variable | language_code_re |
Undocumented |
Class | DjangoTranslation |
Set up the GNUTranslations context with regard to output charset. |
Class | TranslationCatalog |
Simulate a dict for DjangoTranslation._catalog so as multiple catalogs with different plural equations are kept separate. |
Function | activate |
Fetch the translation object for a given language and install it as the current translation object for the current thread. |
Function | all_locale_paths |
Return a list of paths to user-provides languages files. |
Function | catalog |
Return the current active catalog for further processing. This can be used if you need to modify the catalog or want to access the whole message catalog instead of just translating one string. |
Function | check_for_language |
Check whether there is a global language file for the given language code. This is used to decide whether a user-provided language is available. |
Function | deactivate |
Uninstall the active translation object so that further _() calls resolve to the default translation object. |
Function | deactivate_all |
Make the active translation object a NullTranslations() instance. This is useful when we want delayed translations to appear as the original string for some reason. |
Function | do_ntranslate |
Undocumented |
Function | get_language |
Return the currently selected language. |
Function | get_language_bidi |
Return selected language's BiDi layout. |
Function | get_language_from_path |
Return the language code if there's a valid language code found in path . |
Function | get_language_from_request |
No summary |
Function | get_languages |
Cache of settings.LANGUAGES in a dictionary for easy lookups by key. |
Function | get_supported_language_variant |
Return the language code that's listed in supported languages, possibly selecting a more generic variant. Raise LookupError if nothing is found. |
Function | gettext |
Translate the 'message' string. It uses the current thread to find the translation object to use. If no current translation is activated, the message will be run through the default translation object. |
Function | gettext_noop |
No summary |
Function | ngettext |
Return a string of the translation of either the singular or plural, based on the number. |
Function | npgettext |
Undocumented |
Function | parse_accept_lang_header |
Parse the lang_string, which is the body of an HTTP Accept-Language header, and return a tuple of (lang, q-value), ordered by 'q' values. |
Function | pgettext |
Undocumented |
Function | reset_cache |
Reset global state when LANGUAGES setting has been changed, as some languages should no longer be accepted. |
Function | translation |
Return a translation object in the default 'django' domain. |
Variable | _active |
Undocumented |
Variable | _default |
Undocumented |
Variable | _translations |
Undocumented |
Check whether there is a global language file for the given language code. This is used to decide whether a user-provided language is available.
lru_cache should have a maxsize to prevent from memory exhaustion attacks, as the provided language codes are taken from the HTTP request. See also <https://www.djangoproject.com/weblog/2007/oct/26/security-fix/>.
Return selected language's BiDi layout.
Return the language code if there's a valid language code found in path
.
If strict
is False (the default), look for a country-specific variant
when neither the language code nor its generic variant is found.
Analyze 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 URL path prefix will be checked for a language code, otherwise this is skipped for backwards compatibility.
Return the language code that's listed in supported languages, possibly selecting a more generic variant. Raise LookupError if nothing is found.
If strict
is False (the default), look for a country-specific variant
when neither the language code nor its generic variant is found.
lru_cache should have a maxsize to prevent from memory exhaustion attacks, as the provided language codes are taken from the HTTP request. See also <https://www.djangoproject.com/weblog/2007/oct/26/security-fix/>.
Parse the lang_string, which is the body of an HTTP Accept-Language header, and return a tuple of (lang, q-value), ordered by 'q' values.
Return an empty tuple if there are any format errors in lang_string.