Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2020-01-07 19:58:33 +0300
committerJo-Philipp Wich <jo@mein.io>2020-01-08 22:21:23 +0300
commit460bdfe814a34ca5300e7a1a57efecff590dd414 (patch)
treed27cfc11029bffe40bee230ff6e067b9e2c84865 /build
parenta8087bd761efd704834ca6c065d334239ba80a47 (diff)
build: sort location annotation table in i18n sync process
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>
Diffstat (limited to 'build')
-rwxr-xr-xbuild/i18n-scan.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/build/i18n-scan.pl b/build/i18n-scan.pl
index 5ac1cb77d4..fc516c6a04 100755
--- a/build/i18n-scan.pl
+++ b/build/i18n-scan.pl
@@ -272,7 +272,11 @@ if( open C, "| msgcat -" )
{
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;