May be it would better to post this to "Django developers" mailing list?
пятница, 30 мая 2014 г., 15:53:56 UTC+3 пользователь Андрей Меньков написал:Django management command doesn't recognize multiline strings as strings to localize. So such strings don't appear in resulting django.po files after running commandFor example for such a string{code}{{ _(''' fhsdafjkshdfjkasdhfksjytyerwtuiwyertuiywert''') }}{code}
I might be the bug of GNU xgettext utility, because makemessages uses it to produce *.po files, but after running xgettext I became sure that the problem is in the makemessages command, not xgettext.I ran xgettext using the following commandxgettext --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --keyword=pgettext:1c,2 --keyword=npgettext:1c,2,3 --keyword=pgettext_lazy:1c,2 --keyword=npgettext_lazy:1c,2,3 --from-code UTF-8 --add-comments=Translators --from-code utf-8 -d django -p ./output_dir -L Python temp_i18n_template.html
After running this command I got file output_dir/django.po with specified string inside it.What I can do now? What do you think about this "bug" ?
P.S. It's my first attempt to contribute to Django somehow. So please do not judge strictly). I haven't found anywhere about this problem and about its' fixes too.
Turns a Django template into something that is understood by xgettext. Itdoes so by translating the Django translation tags into standard gettextfunction invocations.Function calling results:>> templatize(" {{ _('kfhdsajfkh') }} ")>> ('kfhdsajfkh')>> templatize(""" {{ _(''' abcdefghhjkfhsdajfk fsdauyuirywer ''') }}""")>> XX XXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXX XXSo it can be seen that templatize function marks multiline strings as not needed to translate.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO7PdF8%3DrNwR%3DOxAGs7TVv8NXA6c8Q%3DA5kD71eOb2mY8mWixCA%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/q2KNl0Bha6o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL40Fptj%3DuHZ9qOdCgRpLBdsJw93%3DVEX7JCBO2BFzQuh_DV3NA%40mail.gmail.com.