From: Bruno Haible Date: Sun, 2 Jan 2022 16:40:52 +0000 (+0100) Subject: xgettext: Deprecate option '--sort-output'. X-Git-Tag: v0.22~217 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f15c0f7ea16cdadc102dcb18481c7d48ae99b286;p=thirdparty%2Fgettext.git xgettext: Deprecate option '--sort-output'. Suggested by Lauri Nurmi in . * gettext-tools/src/xgettext.c (main): Warn when option '--sort-output' is used. (usage): Mark the option '--sort-output' deprecated. * gettext-tools/doc/xgettext.texi: Likewise. * NEWS: Mention it. --- diff --git a/NEWS b/NEWS index f5ced5bdb..7684c8699 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ Version 0.21.1 - February 2022 * The base Unicode standard is now updated to 14.0.0. +* xgettext: + The xgettext option '--sorted-output' is now deprecated. + * Portability: - Building on macOS 11/arm64 is now supported. diff --git a/gettext-tools/doc/xgettext.texi b/gettext-tools/doc/xgettext.texi index b2c6374fa..7cd9ec8ff 100644 --- a/gettext-tools/doc/xgettext.texi +++ b/gettext-tools/doc/xgettext.texi @@ -1,5 +1,5 @@ @c This file is part of the GNU gettext manual. -@c Copyright (C) 1995-2020 Free Software Foundation, Inc. +@c Copyright (C) 1995-2022 Free Software Foundation, Inc. @c See the file gettext.texi for copying conditions. @pindex xgettext @@ -537,8 +537,8 @@ lines which are wider than the output page width will be split. @opindex -s@r{, @code{xgettext} option} @opindex --sort-output@r{, @code{xgettext} option} @cindex sorting output of @code{xgettext} -Generate sorted output. Note that using this option makes it much harder -for the translator to understand each message's context. +Generate sorted output (deprecated). Note that using this option makes it +much harder for the translator to understand each message's context. @item -F @itemx --sort-by-file diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index e9fb4a0ab..0259f6da5 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -1,5 +1,5 @@ /* Extracts strings from C source file to Uniforum style .po file. - Copyright (C) 1995-1998, 2000-2016, 2018-2021 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2016, 2018-2022 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software: you can redistribute it and/or modify @@ -742,6 +742,11 @@ xgettext cannot work without keywords to look for")); error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"), "--its", "--language"); + /* Warn when deprecated options are used. */ + if (sort_by_msgid) + error (EXIT_SUCCESS, 0, _("The option '%s' is deprecated."), + "--sort-output"); + if (explicit_its_filename == NULL) { its_dirs = get_search_path ("its"); @@ -1211,7 +1216,7 @@ Output details:\n")); --no-wrap do not break long message lines, longer than\n\ the output page width, into several lines\n")); printf (_("\ - -s, --sort-output generate sorted output\n")); + -s, --sort-output generate sorted output (deprecated)\n")); printf (_("\ -F, --sort-by-file sort output by file location\n")); printf (_("\