You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
What warning are you seeing? Those are entries marked as obsolete – I'm not sure what we should do with them anyway. (I'd just trash them in the general case; PO files are version controlled, right?)
WARNING: Start of line didn't match any expected keyword.
And no, you should not delete them, even if PO files are versioned in SCM, in settings like ours where there is a daily extraction + merge or pot to po, it can happen that someone screws up and then the po gets empty and then it gets fixed on the next day, and msgmerge will automatically recover the commented lines #~
If you delete them that means manual intervention and it's horrible
It seems that obsolete entries like the one mentioned by @tsdgeos are handled fine.
The problem seems rather on obsolete entries with previous strings, e.g.
In particular, the #~| lines (previous strings of obsolete entries).
In this case, PoFileParser will fail because:
the loop in parse() finds the line starting with #, then with ~, so it calls _process_message_line() marking the result as obsolete=True
_process_message_line() calls _process_keyword_line() as it is not a "continuation" line of a string
_process_keyword_line() tries to look for any of the elements in _keywords at the beginning, and since there is none (the first character in line passed to _process_keyword_line() is |), it calls the _invalid_pofile() with the mentioned error message
In general, it seems like PoFileParser does not handle previous strings in entries at all, like:
make PoFileParser handle previous strings in entries, both valid and obsolete ones
rewrite PoFileParser, and possibly also write_po() in the same module, to use polib: https://bitbucket.org/izi/polib (which already handles everything just fine)
Activity
akx commentedon Apr 4, 2018
Hi!
What warning are you seeing? Those are entries marked as obsolete – I'm not sure what we should do with them anyway. (I'd just trash them in the general case; PO files are version controlled, right?)
tsdgeos commentedon Apr 4, 2018
Warning is
WARNING: Start of line didn't match any expected keyword.
And no, you should not delete them, even if PO files are versioned in SCM, in settings like ours where there is a daily extraction + merge or pot to po, it can happen that someone screws up and then the po gets empty and then it gets fixed on the next day, and msgmerge will automatically recover the commented lines #~
If you delete them that means manual intervention and it's horrible
pinotree commentedon Jul 7, 2019
It seems that obsolete entries like the one mentioned by @tsdgeos are handled fine.
The problem seems rather on obsolete entries with previous strings, e.g.
In particular, the
#~|lines (previous strings of obsolete entries).In this case,
PoFileParserwill fail because:parse()finds the line starting with#, then with~, so it calls_process_message_line()marking the result asobsolete=True_process_message_line()calls_process_keyword_line()as it is not a "continuation" line of a string_process_keyword_line()tries to look for any of the elements in_keywordsat the beginning, and since there is none (the first character inlinepassed to_process_keyword_line()is|), it calls the_invalid_pofile()with the mentioned error messageIn general, it seems like
PoFileParserdoes not handle previous strings in entries at all, like:So I see two options here:
PoFileParserhandle previous strings in entries, both valid and obsolete onesPoFileParser, and possibly alsowrite_po()in the same module, to usepolib: https://bitbucket.org/izi/polib (which already handles everything just fine)