diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 41bee79204..273e856910 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -515,14 +515,18 @@ pass the translatable string as argument to another function, you can wrap this function inside a lazy call yourself. For example:: from django.utils.functional import lazy - from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ - mark_safe_lazy = lazy(mark_safe, str) + + def to_lower(string): + return string.lower() + + + to_lower_lazy = lazy(to_lower, str) And then later:: - lazy_string = mark_safe_lazy(_("

My string!

")) + lazy_string = to_lower_lazy(_("My STRING!")) Localized names of languages ----------------------------