bugGNU gettext - Bugs: bug #61249, Deprecate xgettext's...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61249: Deprecate xgettext's -s/--sort-output

Submitter:  Lauri Nurmi <lanurmi>
Submitted:  Thu 30 Sep 2021 04:00:22 PM UTC
 
Category:  Programmer tools Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Thu 23 Jun 2022 12:45:00 AM UTC, comment #3: 

> In many applications, source files are splitted into many files and POT strings are not really sorted by context


Some context is still left, namely the source file. Such applications typically have a source file per panel, or per group of panels, or a source file per internal command/operation. Thus the per-file order of messages does provide context.

> I use this option to ensure that, when a new POT is generated, diff is easier to read.


The problem when you do so is that you deprive translators from valuable context.

Your desire to compare an old and a new POT file can be implemented in either of two ways, without using the xgettext -s option:
(a) Use msgcmp,
(b) Use 'msgcat -s' on each the old and the new POT file, and compare the results using your preferred comparator program.

Bruno Haible <haible>
Project Administrator
Wed 20 Apr 2022 09:02:31 AM UTC, comment #2: 

commentaire #1 :

> Thanks for the suggestion. I agree that the use of this option typically will cause more harm than good.
>
> Implemented through https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=f15c0f7ea16cdadc102dcb18481c7d48ae99b286
>


I use this option to ensure that, when a new POT is generated, diff is easier to read. In many applications, source files are splitted into many files and POT strings are not really sorted by context, even when not using this option.

Cédric Anne <canne>
Sun 02 Jan 2022 04:42:58 PM UTC, comment #1: 

Thanks for the suggestion. I agree that the use of this option typically will cause more harm than good.

Implemented through https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=f15c0f7ea16cdadc102dcb18481c7d48ae99b286

Bruno Haible <haible>
Project Administrator
Thu 30 Sep 2021 04:00:22 PM UTC, original submission:  

xgettext has the argument -s with the following description:

-s, --sort-output           generate sorted output

The official Gettext documentation itself points out about --sort-output that "using this option makes it much harder for the translator to understand each message’s context".

I propose deprecating the --sort-output switch, as in my experience some real-world projects use the switch for no reason, and without understanding its consequences. As the output of "--help" just states "generate sorted output", without a word of warning, surely that sounds nice and elegant.

When should sorted output actually be used anyway? To me it seems sorting msgids of a POT file only has one huge disadvantage and no advantages. Messages related to each other are often placed far away from each other in the .po files translators work on.

Deprecating, in practice, could mean:

  • at least adding a warning to the --help output, something like "(not recommended)" or "(use with caution)" or "(depracated").
  • removing the switch from the --help output, but still accepting it.
  • issuing a warning when xgettext is invoked with the switch.
Lauri Nurmi <lanurmi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by canne (Posted a comment)
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by lanurmi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-02 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2021-12-07 haible SummaryDepracate xgettext's -s/--sort-output Deprecate xgettext's -s/--sort-output

    Back to the top


    Powered by Savane 3.9