smhg / gettext-parser

Parse and compile gettext po and mo files, nothing more, nothing less
MIT License
158 stars 44 forks source link

Silent error doesnt compile my .po #14

Closed cloud-walker closed 8 years ago

cloud-walker commented 8 years ago

In my application I have some broken .po:

msgid "%s appunti e documenti condivisi da studenti in tutta Italia"
msgstr "%s notas e documentos compartilhados por estudantes de todo o mundo"

msgid "documenti per %s"
msgstr "documentos por %s""

There is a double quote duplication on the last line. Using gettext-parser no error was raised... what should I do? Its a bug? Or should I use a linter? If so there is something out there?

andris9 commented 8 years ago

gettext-parser is a forgiving parser, it never raises errors. The parser tries to fetch as much data as possible, even if the file is not valid

cloud-walker commented 8 years ago

What's the point of a forgiving compiler?

BTW, if so I think it should be noted on the documentation (README?).

As it is now I cant use this repo... I have to switch to something else as dependency for my package.

andris9 commented 8 years ago

It's the parser that is forgiving, not the compiler. If you parse an invalid file then you end up with some kind of represenation of the parsed data. If you compile this data back to po or mo, then it is compiled exactly as defined in the data structure.