[wesnoth-commits] [wesnoth/wesnoth] 3761fa: wmlxgettext: sort-by-filename before processing files

Steve Cotton noreply at github.com
Thu Dec 2 08:54:38 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 3761faf92579651ef0fcc5467e707431618cb31d
      https://github.com/wesnoth/wesnoth/commit/3761faf92579651ef0fcc5467e707431618cb31d
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2021-12-02 (Thu, 02 Dec 2021)

  Changed paths:
    M data/tools/wmlxgettext

  Log Message:
  -----------
  wmlxgettext: sort-by-filename before processing files

Add a sort inside wmlxgettext so that the order of filenames on the command
line doesn't affect the output. The sort is run unconditionally, because I
don't see a usecase for not enabling it. For consistency with xgettext and
msgcat, if there was an option to enable it then it would be called
`--sort-by-file`.

The aim of this change is to reduce the number of changes in .po files caused
by a pot-update. When multiple comments refer to the same translatable string,
separate runs of pot-update could generate them in a random order. If I've
understood the root cause correctly, wmlxgettext itself was deterministic, but
the order of the files on wmlxgettext's command line was not deterministic.

For testing, I tried reversing the sort order; the resulting reordering hit
lines that commonly swap order during pot-updates.

This affects the ordering of the lines beginning `#.` that are generated from
`#po:` comments and also those auto-generated from `[message]speaker=`, etc.





More information about the Commits mailing list