Bug 34959: Sort PO files correctly
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Oct 2023 14:48:57 +0000 (16:48 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 25 Oct 2023 08:11:16 +0000 (22:11 -1000)
commita2e33131ce6d61f63f743ee97fb8d3b6a96cd3f9
treeb402694dfe12fce5220b63ec74c49badbd1b41b6
parent01af59c6fc95bf6b90d8619514227a336820ab96
Bug 34959: Sort PO files correctly

The PO files are not sorted when we update them which leads to
unnecessary changes that are commited: hard to see differences and
make git index grow superfluously.

Test plan:
0. Do not apply this patch
1. gulp po:update --lang es-ES
2. git commit -a -m"First PO update"
3. Run again the gulp update command
4. git diff
=> You have a lot of changes generated here, the po:update is not
idempotent.

5. Apply this patch
6. Run the gulp update command
7 git commit -a -m"PO update after 34959"
8. Run the gulp update command
9. git diff
=> No changes are generated

Note that this patch will all the entries by files, and per line
numbers.
It fixes a bug in some condition, where we add information/context about
the string. For instance search for "For the first occurrence" in the
file. Prior to this patch this was not correct, we didn't add info about
the first occurrence (but whichever in the list).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b337b107e16d47ab79571b9a38d273c9e980b20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
gulpfile.js
misc/translator/xgettext.pl