Commit Graph

155 Commits

Author SHA1 Message Date
Ruben Vermeersch
869f763d80 Release v1.0.0 2015-08-20 15:13:21 +02:00
Ruben Vermeersch
b9394176b1 Handle extracted comments in headers 2015-08-20 15:12:56 +02:00
Ruben Vermeersch
9060221403 Release v0.3.0 2015-07-17 10:36:14 +02:00
Ruben Vermeersch
63c4209cd5 Clean up test names 2015-07-17 10:35:56 +02:00
Ruben Vermeersch
104d114d5d Only write flags when they evaluate to true. 2015-07-17 10:35:25 +02:00
Ruben Vermeersch
db5e540824 Merge pull request #14 from rubenv/fix_issue13
add tests to better document reference comments
2014-08-26 10:38:15 +02:00
Julian Bäume
cfc9b2ae82 add tests to better document reference comments
pofile does not process reference comments in any way, since the format of
references is not exactly specified. This test specifies, what users of
pofile can expect the library to do.
2014-08-12 17:47:47 +02:00
Ruben Vermeersch
2e1640d847 Release v0.2.12 2014-07-18 10:55:53 +02:00
Ruben Vermeersch
b499b7f449 Rebuild for #12. 2014-07-18 10:55:15 +02:00
Ruben Vermeersch
e42dc28fd2 Merge pull request #12 from Open-Xchange-Frontend/cstring_escapes
Cstring escapes
2014-07-18 10:54:52 +02:00
Julian Bäume
e1742e66a6 properly escape all unprintable characters
writing messages should no be in line with gettext tools. I tested
using msgcat, it provides the same results.

For some common use-cases I wrote explicit tests, for uncommon and
even unwanted use-cases I wrote one test to make sure pofile works
like msgcat for those messages
2014-06-23 18:24:02 +02:00
Candid Dauth
4cfebdee80 Fixed unescaping of all escaped C String characters.
Signed-off-by: Julian Bäume <julian@svg4all.de>

Conflicts:
	lib/po.js
2014-06-23 15:03:58 +02:00
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