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:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Jump to the original submission

Fri 14 Jul 2023 04:35:39 PM UTC, comment #9: 

Ben wrote:

> I see that the option is only deprecated for xgettext, not for the other tools, such as msgmerge.


Thanks for reporting this. 'msgmerge' is most often used to produce PO files for translators; therefore it needs to have the option deprecated as well. Just done that in
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=15a9b25f4ec6fa23191136da48553bbb9d966831

However, I won't deprecate the option in 'msgcat' and 'msgattrib', since these are "swiss army knife" tools; even the dubious sorting needs to be available there.

> Our application build process depends heavily on the output being sorted. We are very aware of the disadvantage, but we even strip the file locations! We use translator notes to add context.


This is still unfortunate, because most translation tools present the messages to the translator in the order from the POT file. Even if there is sufficient context for each message, this arbitrary ordering will cause constant context switches to the translators.

> That sounds patronizing.


The GNU gettext tools must make compromises between the wishes/needs of the developers and the wishes/needs of the translators. Of course, members of one of these groups can view the compromises as "patronizing".

Bruno Haible <haible>
Group administrator
Fri 14 Jul 2023 04:11:45 PM UTC, comment #8: 

comment #7:

Point taken. I am sorry for my overreaction. Keep up the great work!

Ben <qtclyinh>
Fri 14 Jul 2023 03:23:29 PM UTC, comment #7: 

comment #5:

> I was overwhelmed by the new warning when using the --sort-output option.
>
> If someone does not see a reason to use it, that does not mean that other people don't have a reason to use it. That sounds patronizing.


Following the same reasoning, one could argue that compilers should not issue any warnings, because the code is fine per se, and the developer might be deliberately doing something that looks suspicious. And instead of issuing compiler warnings, all the compiler users in the world should be educated about common (and uncommon) pitfalls.

> Also, if projects use it and are not aware of of the disadvantages, educate them, as suggested.


Even trivial 2-line patches tend to take between 1 to 3 years to get acknowledged in any way with many free/open projects. With that in mind, I don't expect a quick and huge success, if a random person (such as myself) would start submitting far less trivial changes to random projects, using a tone that sounds like I'm educating them how to do things.

Lauri Nurmi <lanurmi>
Fri 14 Jul 2023 12:18:18 PM UTC, comment #6: 

Update: I see that the option is only deprecated for xgettext, not for the other tools, such as msgmerge. That still works in our scenario and would not generate issues.

Ben <qtclyinh>
Fri 14 Jul 2023 11:58:09 AM UTC, comment #5: 

I was overwhelmed by the new warning when using the --sort-output option. Our application build process depends heavily on the output being sorted. We are very aware of the disadvantage, but we even strip the file locations! We use translator notes to add context.

If someone does not see a reason to use it, that does not mean that other people don't have a reason to use it. That sounds patronizing.

Also, if projects use it and are not aware of of the disadvantages, educate them, as suggested. A warning in the help file and/or a warning in the output when using the option would suffice.

Ben <qtclyinh>
Sat 17 Jun 2023 01:50:59 PM UTC, comment #4: 

The fix is contained in gettext 0.22.

Bruno Haible <haible>
Group administrator
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>
Group 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>
Group 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 qtclyinh (Posted a comment)
  • -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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-17 haible StatusFixed Fix Released
    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.13-d3ae.
    Corresponding source code