In Django, I gladly use ugettext_lazy to delay a line feed only when it needs to be represented.
The problem is that when I connect a lazy string to a normal string or when I use its methods (e.g. capitalize ()), the string is evaluated and I lose the lazy translation.
eg.
label = ugettext_lazy('my label') #This is lazy label_concat = label + ' some other string' #'label_concat' contains transalted 'label' label_cap = label.capitalize() #'label_cap' contains transalted 'label' #Set language ... print label #Translated print label_cap #Not translated
I know this is the normal behavior of Django, but I am wondering if anyone has resolved this issue.
source share