The scanning routine has caused unnecessary changes to the .po files
if a string has been found in multiple files and those files have been
found in different order than the previous time.
Sort the location annotations to avoid unnecessary changes to the .po files.
(sort is alphabetic, so the line numbers are also sorted alphabetically)
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[apply a Schwartzian transform to sort locations by path, then line number]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit
460bdfe814a34ca5300e7a1a57efecff590dd414)
{
if( length $key )
{
- my @positions = @{$stringtable{$key}};
+ my @positions =
+ map { join ':', @$_ }
+ sort { ($a->[0] cmp $b->[0]) || ($a->[1] <=> $b->[1]) }
+ map { [ /^(.+):(\d+)$/ ] }
+ @{$stringtable{$key}};
$key =~ s/\\/\\\\/g;
$key =~ s/\n/\\n/g;