release.pl: fail if transifex doesn't deliver an existing translation

This commit is contained in:
Juergen E. Fischer 2025-02-20 19:35:21 +01:00 committed by Nyall Dawson
parent 1deb1daf03
commit 01c9c27d45
2 changed files with 12 additions and 3 deletions

View File

@ -156,7 +156,7 @@ my $reltag = "final-${newmajor}_${newminor}_${newpatch}";
unless( $skipts ) {
print "Pulling transifex translations...\n";
run( "scripts/pull_ts.sh", "pull_ts.sh failed" );
run( "CONSIDER_TS_DROP_FATAL=1 scripts/pull_ts.sh", "pull_ts.sh failed" );
run( "git add i18n/*.ts", "adding translations failed" );
run( "git commit -n -a -m \"translation update for $version from transifex\"", "could not commit translation updates" );
} else {

View File

@ -207,8 +207,17 @@ rename "i18n/CMakeLists.txt", "i18n/CMakeLists.txt.temp" || die "cannot rename i
open I, "i18n/CMakeLists.txt.temp";
open O, ">i18n/CMakeLists.txt";
while(<I>) {
if( /^SET\(TS_FILES /i ) {
print O "set(TS_FILES " . join( " ", map { "qgis_$_\.ts"; } @ts ) . ")\n";
if( /^SET\(TS_FILES (.*)\)/i ) {
my @oldts = split /\s+/, $1;
my @newts = map { "qgis_$_\.ts"; } @ts;
for my $ts (@oldts) {
die "FATAL: $ts was dropped\n" if exists $ENV{CONSIDER_TS_DROP_FATAL} && ! grep /^$ts$/, @newts;
print STDERR "WARNING: $ts dropped\n" unless grep /^$ts$/, @newts;
}
for my $ts (@newts) {
print STDERR "INFO: $ts added\n" unless grep /^$ts$/, @oldts;
}
print O "set(TS_FILES " . join( " ", @newts ) . ")\n";
} else {
print O;
}