Skip to content

Commit

Permalink
release.pl: fail if transifex doesn't deliver an existing translation
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n authored and nyalldawson committed Feb 20, 2025
1 parent 1deb1da commit 01c9c27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ ($$)

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 {
Expand Down
13 changes: 11 additions & 2 deletions scripts/tsstat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,17 @@
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;
}
Expand Down

0 comments on commit 01c9c27

Please sign in to comment.