Friday, January 22, 2010

Localizing database textarea fields using gettext chokes on \r\n.

I'm trying to avoid changing my database around to accommodate
localized strings. I'm putting all strings from the database into a
holding file (db_messages.py) which get dumped into my django.po file.

The problem is that textarea fields contain "\r\n" as line endings,
and running something like:

_("This is line 1\r\nThis is line 2")

through makemessages will get you an error:

Error: errors happened while running xgettext on db_messages.py
[snip]/db_messages.py:10: internationalized messages should not
contain the `\r' escape sequence

If I add the \r manually to the .po file, the messages will compile
without issue.

Has anyone else bumped into this?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate