Commit Graph

93 Commits

Author SHA1 Message Date
Julian Bäume
d8fc514359 don't remove \n characters from written po file
in Item.toString, all \n characters are removed from the output.
The gettext tools however leave those characters intact. This
will now produce the same output as tools like msgcat.
2014-06-23 15:03:58 +02:00
Ruben Vermeersch
d202e39a60 Release v0.2.11 2014-06-23 14:12:25 +02:00
Ruben Vermeersch
f5056bc57f Merge pull request #11 from Open-Xchange-Frontend/fix_newline_in_msgid
restore previous behaviour with \n in strings
2014-06-23 14:11:52 +02:00
Julian Bäume
af94d8ff5e restore previous behaviour with \n in strings
An incompatible change (that actually breaks po parsing after writing) had
been introduced with commit e164fcfe9d. If
_process returned an array (which is the case for strings containing \n
character), array.toString will return a comma separated list, which is not
valid po syntax. Added a test to restore the behaviour from before the
e164fcfe9d.
2014-06-23 12:30:04 +02:00
Ruben Vermeersch
8e49417916 Release v0.2.10 2014-06-19 17:18:55 +02:00
Ruben Vermeersch
b9534d20fe Recompile. 2014-06-19 17:18:45 +02:00
Ruben Vermeersch
1b5668b5c7 Merge pull request #10 from Open-Xchange-Frontend/handle_empty_comments
handle empty comments correctly
2014-06-19 17:18:01 +02:00
Julian Bäume
08e7db58b3 handle empty comments correctly
since the lines in the parser have all newline characters removed, \s+ will
not match empty comments.

Added an example that makes other tests fail without this patch.
2014-06-19 17:04:03 +02:00
Ruben Vermeersch
eeb1382dfb Release v0.2.9 2014-06-19 14:16:52 +02:00
Ruben Vermeersch
656bfd0b8d Add JSCS, fix style. 2014-06-19 14:16:30 +02:00
Ruben Vermeersch
03572f9711 Merge pull request #9 from Open-Xchange-Frontend/fix_commented_obsolete_strings
Fix commented obsolete strings
2014-06-19 14:05:32 +02:00
Ruben Vermeersch
6af1cf741f Remove node 0.8 from Travis. 2014-06-19 14:02:54 +02:00
Julian Bäume
e164fcfe9d new implementation of items marked obsolete
the current implementation of items marked obsolete did not allow "plain"
comments for these items. However, this is perfectly fine according to
the original gettext tools. When writing a po file, comments for obsolete
items don't contain the '#~ ' mark (tested using msgcat), so this is now
also aligned with the behaviour of the original gettext tools.

For all these cases I added examples in the po files, that failed with the
current implementation and work fine after these changes.
2014-06-19 13:47:30 +02:00
Julian Bäume
8d40e1b3c4 unify string quotes 2014-06-17 21:19:14 +02:00
Ruben Vermeersch
04fe915389 Release v0.2.8 2014-03-21 11:08:59 +01:00
Ruben Vermeersch
2fb07fb1d0 Recompile browser versions for #8. 2014-03-21 11:08:30 +01:00
Ruben Vermeersch
06571c89fc Merge pull request #8 from Open-Xchange-Frontend/multiline_headers
add support for multiline string in headers
2014-03-21 11:08:05 +01:00
Julian Bäume
73b267b3e8 add support for multiline string in headers
Some languages (such as Polish, Russian or Romanian) do have more
complicated plural forms. Those are still expressible by a more
complicated mathematical expression. However, the msgmerge tool of
gettext will in these cases write multiline header fields. When parsing
such files with this lib, the headers get screwed up, so this patch
provides an example (from a pl_PL po file) and fixes this by joining the
lines in the header, before doing the actual parsing.
2014-03-21 10:54:32 +01:00
Ruben Vermeersch
42d6df5373 Release v0.2.7 2014-03-07 10:18:30 +01:00
Ruben Vermeersch
dba7465ba7 Remove unneeded if-clauses. 2014-03-07 10:17:52 +01:00
Ruben Vermeersch
d426c114c7 Add support for obsolete items to fix broken parsing. 2014-03-07 10:15:50 +01:00
Ruben Vermeersch
5a49a3400b Release v0.2.6 2014-03-05 11:48:45 +01:00
Ruben Vermeersch
c103f45002 Recompile for #7. 2014-03-05 11:48:14 +01:00
Ruben Vermeersch
cb12e69ef4 Merge pull request #7 from Open-Xchange-Frontend/write_escaped
add reverse method of extract(string)
2014-03-05 11:47:56 +01:00
Julian Bäume
851a87ebf2 add some real world examples for c-strings in po files
make sure, if a file containing c-string messages is identical after being
parsed and written afterwards.
2014-03-05 11:37:48 +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
Ruben Vermeersch
6903bbf967 Fix build. 2014-03-03 16:20:49 +01:00
Ruben Vermeersch
b82dea6e42 Update contributors. 2014-03-03 16:17:22 +01:00
Ruben Vermeersch
1d74ea4a7a Release v0.2.5 2014-03-03 16:11:50 +01:00
Ruben Vermeersch
783a4129d5 Merge pull request #6 from gabegorelick/serialize-comments
Include comments in `PO.Item` output
2014-03-03 16:11:24 +01:00
Gabe Gorelick
8dba54b095 Document extractedComments 2014-03-02 13:20:18 -05: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
Ruben Vermeersch
c5515d6128 Add Julian Bäume to contributors. 2014-01-22 14:25:10 +01:00
Ruben Vermeersch
c58333c4d1 Fix capital and punctuation. 2014-01-22 14:22:03 +01:00
Ruben Vermeersch
136b969adb Release v0.2.4 2014-01-22 14:19:50 +01:00
Ruben Vermeersch
02471be49f Recompile browserified version. 2014-01-22 14:19:26 +01:00
Ruben Vermeersch
13283fedbe Merge pull request #4 from Open-Xchange-Frontend/fix_msgctxt_default
fix default value of msgctxt field
2014-01-22 05:19:14 -08: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
Ruben Vermeersch
abca810905 Upgrade copyright years. 2014-01-21 16:05:01 +01:00
Ruben Vermeersch
ce410f3427 Release v0.2.3 2014-01-21 16:01:30 +01:00
Ruben Vermeersch
4fa1ce75c5 Recompile. 2014-01-21 16:01:08 +01:00
Ruben Vermeersch
b599a76557 Merge pull request #3 from Open-Xchange-Frontend/support_msgctxt
Support msgctxt field of items
2014-01-21 07:00:52 -08:00
Julian Bäume
87e29b6c21 add documentation for the new field
possibly makes developers happy to have this field documented
2014-01-21 15:46:31 +01:00
Julian Bäume
4ba2cf1cef add distfiles
as compiled by the grunt task. These come in an own commit, since I
didn’t want them to clutter the actual implementation commits.
2014-01-21 15:10:02 +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
94ad44f953 Release v0.2.2 2013-12-23 09:37:40 +01:00
Ruben Vermeersch
c9811bb7aa More documentation. 2013-12-23 09:35:59 +01:00
Ruben Vermeersch
f40ab323dd Add migration notes. 2013-12-23 09:18:28 +01:00