Commit Graph

24 Commits

Author SHA1 Message Date
Ruben Vermeersch
d426c114c7 Add support for obsolete items to fix broken parsing. 2014-03-07 10:15:50 +01:00
Julian Bäume
94f5f4a83e add reverse method of extract(string)
during PO.parse, an extract(string) method is called on each string to
unescape some characters (like " and \). This process should be reverted
in the toString method.

The PO spec says, that all strings should be C-Strings. Otherwise tools
like msgmerge (from the gettext package) will fail parsing po files written
by this library.
2014-03-05 10:13:30 +01:00
Gabe Gorelick
ac85ba0b9c Handle extracted comments 2014-03-02 13:17:20 -05:00
Gabe Gorelick
ada76116b0 Include comments in PO.Item output
Fixes #5
2014-03-02 12:41:40 -05:00
Julian Bäume
a5f3059661 fix default value of msgctxt field
I added a few more edge-cases to the tests for the new msgctxt field and
revealed a bug during that. The default value has been set to empty
string, but should have been null, since the spec says, this field is
optional.
2014-01-22 14:14:03 +01:00
Julian Bäume
c046b62873 implement writing msgctxt field
since the parser can extract this information, now, the writer should
also be able to write it back to a po file
2014-01-21 15:06:11 +01:00
Julian Bäume
6790bfb466 add parsing support for msgctxt field of poitems
The gettext format specifies a msgctxt field for translated items. An
example of how to use this field has been added to the tests and the
parsing of this attribute has been implemented.
2014-01-21 15:05:58 +01:00
Ruben Vermeersch
6b2cb2e71e Stop using util.format.
This will massively shrink the browserified footprint.
2013-12-18 16:46:09 +01:00
Ruben Vermeersch
0d4f80e7f6 Write flags out when serializing. 2013-12-17 16:35:40 +01:00
Ruben Vermeersch
fff8349e25 Parse item flags. 2013-12-17 15:04:44 +01:00
Ruben Vermeersch
fe2e17990a Fix the async calls.
This is a breaking change. But that's okay, the previous behavior for
async was just plain wrong and would crash the entire node process,
which is unacceptable. A major version bump will be needed to release
this.
2013-12-17 14:30:07 +01:00
Ruben Vermeersch
e61e535a79 Add JSHint. Fix style and some potential bugs. 2013-12-16 16:36:32 +01:00
Mike Holly
f7d70f302b Merge pull request #5 from elewinso/master
added support for CRLF files - window style
2013-10-31 07:02:48 -07:00
Sander Houttekier
c7c62caa54 Update parsing of headers
Remove wrong `.replace()` statement which breaks any language file from a language ending with the character `n`. It is unclear to me why this replace is even there. As it is even invalid to replace without supplying a string with what it needs to be replaced.
2013-10-31 14:13:25 +01:00
elewinso
47adb2be9e added support for CRLF files - window style 2013-09-12 14:01:37 +03:00
Mike Holly
3eab1ece05 Fixed msgid_plural error 2012-01-15 11:31:07 -08:00
Mike Holly
899c948784 Fixed export bug. 2012-01-02 16:06:32 -08:00
Mike Holly
69fcd1b40d Made parser much more robust. Now handles files without whitespace seps. 2012-01-02 15:52:05 -08:00
Mike Holly
1e13e78654 Fixed parsing error. 2012-01-01 17:52:51 -08:00
Mike Holly
ea1fcd870f Added toString method for PO 2012-01-01 17:02:19 -08:00
Mike Holly
1bae2deab0 Fixed error in loading. 2011-12-26 18:22:05 -08:00
Mike Holly
f507223705 Added Item.toString() and moved save logic there. 2011-12-22 16:17:04 -08:00
Mike Holly
79b8009b2a Can now read and write most PO files. Added simple test. 2011-12-22 16:12:01 -08:00
Mike Holly
5ea3f06a8c Initial commit 2011-12-21 22:50:01 -08:00