I am working on a django application, which need to support multiple languages. This application involves some amount of javascript code. In this javascript code, there are some multi-line strings, which need to be translated.
We have tried this structure:
var $text = gettext('Lorem ipsum dolor sit amet, consectetur adipisicing ' +
'elit, sed do eiusmod tempor incididunt ut labore et ' +
'dolore magna aliqua. Ut enim ad minim veniam, quis ');
This does not work. makemessages stops at the first + sign, so in the .po file it shows up as:
msgid "Lorem ipsum dolor sit amet, consectetur adipisicing "
A bit of searching on the net lead to a style guide, which recommends the format we are already using for multi-line strings. But that style is not supported by makemessages.
I tried removing the + characters at the end of the lines. Without the + characters, makemessages can find the full string, but it no longer works in the browser.
Does there exist a style for multi-line strings, which is both supported by makemessages and can be expected to work in all major browsers?
So far I have found that what makemessages is actually doing is to replace all single-quoted strings with double-quoted strings and runs the result through xgettext claiming it to be C code.