Changeset 38761 for main/trunk


Ignore:
Timestamp:
2024-02-20T21:30:00+13:00 (3 months ago)
Author:
anupama
Message:

Changes to get the Italian translation spreadsheet files manually submitted without them throwing up so many warnings about submission source text being different from source text. Issues were 1. entity ampersand#10; (line feed character) was now followed by newline rather than followed by space when the unicode file came out of Excel, and it needed to be removed now. Excel also doesn't seem to add an extra space at the start. So we don't want to remove spaces at start where this exist in the original source string. Both were changes to gti-process-spreadsheet.pl. 2. Next, in gti.pl, a fix I had made in revision 33436 to remove extra spaces at line end that got added when files were processed for the glihelp module, would for regular properties files remove actual spaces at line end that marked submission source different from source. The earlier change may still be necessary for glihelp, so I now only remove that extra space if the module is glihelp.

Location:
main/trunk/greenstone2/bin/script
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gti-process-spreadsheet.pl

    r28503 r38761  
    106106
    107107        # Remove the blank space Excel adds at the start of each line
    108     $source_file_chunk_text =~ s/\n /\n/g;
    109     $target_file_chunk_text =~ s/\n /\n/g;
     108    # New excel conversion (noticed Feb 2024) didn't require this change
     109    #$source_file_chunk_text =~ s/\n /\n/g;
     110    #$target_file_chunk_text =~ s/\n /\n/g;
    110111
    111112    # Remove Excel's doubled-up quotes
     
    117118    $target_file_chunk_text =~ s/
 /\n/g;
    118119
     120    # New excel conversion (noticed Feb 2024)
     121    $source_file_chunk_text =~ s/
//g;
     122    $target_file_chunk_text =~ s/
//g;
     123   
    119124    print "<SourceFileText key=\"" . $source_file_chunk_key . "\">\n" . $source_file_chunk_text . "\n</SourceFileText>\n";
    120125    print "<TargetFileText key=\"" . $target_file_chunk_key . "\">\n" . $target_file_chunk_text . "\n</TargetFileText>\n";
  • main/trunk/greenstone2/bin/script/gti.pl

    r38547 r38761  
    665665    foreach my $submission_line (@submission_lines) {
    666666    $submission_line =~ s/\r$//;
    667     $submission_line =~ s/ +$//;
     667    $submission_line =~ s/ +$// if ($translation_file_key eq "glihelp");
    668668        #&log_message("  $submission_line");
    669669    }
     
    738738
    739739        # Make sure the submitted source chunk matches the source file chunk
     740        #if ($source_file_key_to_submission_mapping{$chunk_key} ne $source_file_key_to_text_mapping{$chunk_key}
     741        #    && $source_file_key_to_submission_mapping{$chunk_key} ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
    740742        if (trim($source_file_key_to_submission_mapping{$chunk_key}) ne trim($source_file_key_to_text_mapping{$chunk_key})
    741743            && trim($source_file_key_to_submission_mapping{$chunk_key}) ne &unmake_text_xml_safe(trim($source_file_key_to_text_mapping{$chunk_key}))) {
    742         #if (&unmake_text_xml_safe($source_file_key_to_submission_mapping{$chunk_key}) ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
     744        ##if (&unmake_text_xml_safe($source_file_key_to_submission_mapping{$chunk_key}) ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
    743745                    #&log_message("**** submission source:\n|$source_file_key_to_submission_mapping{$chunk_key}|\n");
    744746                #&log_message("**** unmake xml safe source:\n|" . &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key}) ."|\n");
Note: See TracChangeset for help on using the changeset viewer.