]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Add ability to write PO files without translator comment lines.
authorBruno Haible <bruno@clisp.org>
Wed, 24 Oct 2018 23:03:32 +0000 (01:03 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 24 Oct 2018 23:03:32 +0000 (01:03 +0200)
* gettext-tools/src/write-po.h (message_print_style_comment): New declaration.
* gettext-tools/src/write-po.c (print_comment): New variable.
(message_print_style_comment): New function.
(message_print_comment): Output nothing if print_comment is false.

gettext-tools/src/write-po.c
gettext-tools/src/write-po.h

index e993d2cf17c12f7f1a19813e05a06b620700badd..cb9b99bd6d6012fd055ed4dc4cb8666139c22132 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU gettext - internationalization aids
-   Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2016, 2018 Free Software
    Foundation, Inc.
 
    This file was written by Peter Miller <millerp@canb.auug.org.au>
@@ -240,10 +240,18 @@ enum
 
 /* Output mp->comment as a set of comment lines.  */
 
+static bool print_comment = true;
+
+void
+message_print_style_comment (bool flag)
+{
+  print_comment = flag;
+}
+
 void
 message_print_comment (const message_ty *mp, ostream_t stream)
 {
-  if (mp->comment != NULL)
+  if (print_comment && mp->comment != NULL)
     {
       size_t j;
 
index 97fd0c160740ad3604ac17201c7719053804e6e2..0f5ca32fef91a34ec570e269555bd83ebad4fc80 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU gettext - internationalization aids
-   Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2015-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2015-2016, 2018 Free Software
    Foundation, Inc.
 
    This file was written by Peter Miller <millerp@canb.auug.org.au>
@@ -69,6 +69,8 @@ extern void
        message_print_style_uniforum (void);
 extern void
        message_print_style_escape (bool flag);
+extern void
+       message_print_style_comment (bool flag);
 extern void
        message_print_style_filepos (enum filepos_comment_type type);