From: Bruno Haible Date: Wed, 24 Oct 2018 23:03:32 +0000 (+0200) Subject: Add ability to write PO files without translator comment lines. X-Git-Tag: v0.20~283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02e832f991b0cb89b7f8cac1e833e3ef0729d009;p=thirdparty%2Fgettext.git Add ability to write PO files without translator comment lines. * 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. --- diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index e993d2cf1..cb9b99bd6 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -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 @@ -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; diff --git a/gettext-tools/src/write-po.h b/gettext-tools/src/write-po.h index 97fd0c160..0f5ca32fe 100644 --- a/gettext-tools/src/write-po.h +++ b/gettext-tools/src/write-po.h @@ -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 @@ -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);