Closed flozz closed 2 years ago
Hi! I recently took over this project and I'm trying to follow up on open issues. What do you expect as support? Passing them through while parsing/compiling?
Hello,
Thank you for your interest in this issue!
I mean just keep them in the Object generated after parsing the .po file, and write them down when converting the Object to a .po file.
Of course the obsolete message must not be kept when compiling to .mo
Regards,
I've needed that functionality, so with patch-package
I've modified gettext-parser
to handle obsolete entries. https://gist.github.com/KapitanOczywisty/eaf5e18570376c6ffbe3aeaf047e0377
After modification obsolete translations are kept in optional obsolete
property:
{
//...
obsolete: {
'': {
'Obsolete message': {
msgid: 'Obsolete message',
comments: { translator: 'Obsolete comment' },
msgstr: [
'Message obsolete.\nLines are properly handled, even for obsolete translations.'
]
}
}
}
}
and properly compiled back into po
file:
# Obsolete comment
#~ msgid "Obsolete message"
#~ msgstr ""
#~ "Message obsolete.\n"
#~ "Lines are properly handled, even for obsolete translations."
This might not be a perfect implementation, but works and could be used as place to start. @smhg what do you think?
@KapitanOczywisty thank you! It would be great to add this. Would you be able to create a PR which includes tests for:
Hello,
have you planned to support obsolete messages in your po parser?
Example of obsolete messages in a po file:
regards,