$ 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.