diff options
author | Steve McIntyre <steve@einval.com> | 2018-06-07 02:09:31 +0100 |
---|---|---|
committer | Steve McIntyre <steve@einval.com> | 2018-06-07 02:09:31 +0100 |
commit | 93f767be12ff83eb37564a84fcb920e62e631ef7 (patch) | |
tree | 57329ca8936d6775cee5b418fcc3332e1f539257 /touch_translations.pl | |
parent | fcf52e170a5d84dae5f719f85b6427ddcecbea43 (diff) |
Fix up logic bug in touch_translations.pl
The original logic was broken and was causing comparisons against the
wrong originals for some translated files. This looks like it was
being hidden by the lax CVS versioning code underneath, so we never
saw the bug previously.
Split the code out, correct it and document what it's actually doing
now. Fixes a lot of reported errors with git revisions not being
found...
Diffstat (limited to 'touch_translations.pl')
-rwxr-xr-x | touch_translations.pl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/touch_translations.pl b/touch_translations.pl index 3f0942f7b18..1a88c0d49a5 100755 --- a/touch_translations.pl +++ b/touch_translations.pl @@ -107,8 +107,18 @@ foreach $lang (@langs) { $original = $transcheck->original(); $maxdelta = $transcheck->maxdelta() if $transcheck->maxdelta(); $mindelta = $transcheck->mindelta() if $transcheck->mindelta(); - - next unless not defined $original or $original eq $arglang; + + # English is the default original language if the header in the + # translated file doesn't specify otherwise + if (!defined $original) { + $original = "english"; + } + + # If the original language in the translated file isn't the + # language we started with here, bail now - it's not interesting + if (! ($original eq $arglang)) { + next; + } $difference = $VCS->count_changes($argfile, $langrev, $origrev); if (!defined $difference) { |