Ignore:
Timestamp:
2005-06-08T14:03:53+12:00 (19 years ago)
Author:
mdewsnip
Message:

Completed GTI searching and correcting functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/gti.pl

    r10020 r10027  
    386386    # The key of the file to translate (ensure it is lowercase)
    387387    my $translation_file_key = lc(shift(@_));
     388    # Whether to submit a target chunk even if it hasn't changed
     389    my $force_submission_flag = shift(@_);
    388390
    389391    # Check that the necessary arguments were supplied
     
    489491        next;
    490492    }
    491 
    492     # Apply the submitted translations
    493     if (defined($target_file_key_to_submission_mapping{$chunk_key})) {
    494         $target_file_key_to_text_mapping{$chunk_key} = $target_file_key_to_submission_mapping{$chunk_key};
     493    }
     494
     495    # Apply the submitted translations
     496    foreach my $chunk_key (keys(%target_file_key_to_submission_mapping)) {
     497    if ($force_submission_flag || $target_file_key_to_submission_mapping{$chunk_key} ne $target_file_key_to_text_mapping{$chunk_key}) {
     498        $target_file_key_to_text_mapping{$chunk_key} = $target_file_key_to_submission_mapping{$chunk_key};
    495499        $target_file_key_to_comment_date_mapping{$chunk_key} = $submission_date;
    496     }
     500    }
    497501    }
    498502
     
    845849        $i++;
    846850        $line = $file_lines[$i];
    847         $line =~ s/(\s*)$//;  # Remove any nasty whitespace, carriage returns etc.
     851        $line =~ s/\s*([^\\]\#.+)?$//;  # Remove any comments and nasty whitespace
    848852        }
    849853
Note: See TracChangeset for help on using the changeset viewer.