Thanks for the reply Daiki:

I had a similar test, but I used yours just to validate; however, my output
is not as expected using v0.18.3.2 from
http://git.savannah.gnu.org/cgit/gettext.git (Ubuntu 13.10)

Is there another release I should be using to get the proper output as
yours?

$ cat test.js

/* comment 1 */
gettext('test string 1');

// comment 2
gettext('test string 2');⏎

$ xgettext --add-comments --omit-header --no-location -o - test.js

#. comment 1 */
msgid "test string 1"
msgstr ""

msgid "test string 2"
msgstr ""

$ xgettext --version

xgettext (GNU gettext-tools) 0.18.3
Copyright (C) 1995-1998, 2000-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.

$ gettext --version

gettext (GNU gettext-runtime) 0.18.3
Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.


On Mon, Apr 14, 2014 at 7:46 AM, Daiki Ueno <[email protected]> wrote:

> James D Holby <[email protected]> writes:
>
> >> Could you elaborate what you mean with "developer comments"?
> >
> > In the PO files they can contain:
> >
> > #. Programmer comment
> >
> > The manual mentions we can add keywords to extract comments to be
> extracted
> > into the PO file so that the developer can give context to the
> translator.
> >
> > However, it doesn't seem that these are currently extracted or
> recognized in
> > 0.8.13 with JavaScript and adding the -c/--add-comments options.
>
> It's strange.  With this simple test.js:
>
>   /* comment 1 */
>   gettext('test string 1');
>
>   // comment 2
>   gettext('test string 2');
>
> I get the following PO:
>
>   #. comment 1
>   msgid "test string 1"
>   msgstr ""
>
>   #. comment 2
>   msgid "test string 2"
>   msgstr ""
>
> by calling xgettext as follows:
>
>   xgettext --add-comments --omit-header --no-location -o - test.js
>
> gettext-tools/tests/xgettext-javascript-1 actually contains a similar
> test, though it uses a different option: --add-comments=TRANSLATORS:
>
> Regards,
> --
> Daiki Ueno
>

Reply via email to