If you update the po files using `translate update es-ES`, commit your changes, then run the script again, you will notice that changes are still generated. It's coming from the commented lines showing the #:filepath:line_number info They should be ordered the same way for each run to prevent unnecessary changes.
Created attachment 156781 [details] [review] Bug 34959: Remove unused sub Nothing special here, this sub is not used and we can remove it.
Created attachment 156782 [details] [review] 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).
This is in the context of the migration to weblate https://wiki.koha-community.org/wiki/Translation_server_migration_weblate And the suggestion to let weblate deals with the PO files in their own git repository.
Created attachment 156806 [details] [review] Bug 34959: Remove unused sub Nothing special here, this sub is not used and we can remove it. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 156807 [details] [review] 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>
I'm not sure whether this bug is related, but have added anyway: Bug 34983 - Retranslating causes changes in locale_data.json Feel free to remove if it is not.
From gettext's changelog: Version 0.23 - October 2023 * msgmerge: - The msgmerge option '--sorted-output' is now deprecated.
Created attachment 157082 [details] [review] Bug 34959: Remove unused sub Nothing special here, this sub is not used and we can remove it. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 157083 [details] [review] 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>
Pushed to master for 23.11. Nice work everyone, thanks!
Testing on 23.05.x : 3. Run again the gulp update command 4. git diff With patch I still get a lot off differences there. This patches are not be very important for old branches right ?
(In reply to Fridolin Somers from comment #11) > Testing on 23.05.x : > > 3. Run again the gulp update command > 4. git diff > > With patch I still get a lot off differences there. > > This patches are not be very important for old branches right ? It is needed for the move to Weblate, it must be backported to *all* stable branches for the November releases.
OK on it
Pushed to 23.05.x for 23.05.05
(In reply to Fridolin Somers from comment #14) > Pushed to 23.05.x for 23.05.05 *November release* is next month!
(In reply to Jonathan Druart from comment #15) > (In reply to Fridolin Somers from comment #14) > > Pushed to 23.05.x for 23.05.05 > > *November release* is next month! Ah sorry I thought ASAP before November release ^ Reverted
(In reply to Fridolin Somers from comment #16) > (In reply to Jonathan Druart from comment #15) > > (In reply to Fridolin Somers from comment #14) > > > Pushed to 23.05.x for 23.05.05 > > > > *November release* is next month! > > Ah sorry I thought ASAP before November release ^ > Reverted Hi Frido, I see this has been pushed, reverted, and pushed again. Can you please update the "Version(S) released in". Thank you!
(In reply to Pedro Amorim from comment #17) > (In reply to Fridolin Somers from comment #16) > > (In reply to Jonathan Druart from comment #15) > > > (In reply to Fridolin Somers from comment #14) > > > > Pushed to 23.05.x for 23.05.05 > > > > > > *November release* is next month! > > > > Ah sorry I thought ASAP before November release ^ > > Reverted > > Hi Frido, I see this has been pushed, reverted, and pushed again. Can you > please update the "Version(S) released in". Thank you! Done, my bad. Sorry!
*** Bug 24797 has been marked as a duplicate of this bug. ***