pofile icon indicating copy to clipboard operation
pofile copied to clipboard

msgctxt spanning more than one line is not captured

Open rtymchyk opened this issue 8 years ago • 2 comments

xgettext output:

#: standard input:49
msgctxt ""
"hello world hello world hello world hello world hello world hello world hello world"
"hello world hello world"
msgid "inviting friends"
msgstr ""

Parsed output:

{ 
       msgid: 'inviting friends',
       msgctxt: '',
       references: [Object],
       msgid_plural: null,
       msgstr: [Object],
       comments: [],
       extractedComments: [],
       flags: {},
       obsolete: false 
}

It appears as though we need to add a context = 'msgctxt'; when we're on a msgctxt line, and then add another conditional to // Probably multiline string or blank. Since this is not typical usage of context (very large string), I thought it might be better to discuss first.

rtymchyk avatar Jan 27 '16 16:01 rtymchyk

This is very interesting.

Normally, message contexts are intended to be used as short identifiers. What exactly are you trying to do?

rubenv avatar Jan 27 '16 16:01 rubenv

The problem is that xgettext is unable to parse comments for translators from JavaScript so I end up using the context for this purpose (trying to use it as little as possible though).

rtymchyk avatar Jan 27 '16 16:01 rtymchyk