Changeset 30548 for main/trunk/greenstone2/bin/script
- Timestamp:
- 2016-06-01T19:25:46+12:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/gti.pl
r30490 r30548 519 519 my (%source_file_key_to_gti_command_mapping, %target_file_key_to_gti_command_mapping) = (); 520 520 &build_gs3_configuration($target_language_code, \%source_file_key_to_text_mapping, \%target_file_key_to_text_mapping, 521 \%source_file_key_to_gti_command_mapping, \%target_file_key_to_gti_command_mapping );521 \%source_file_key_to_gti_command_mapping, \%target_file_key_to_gti_command_mapping, 1); 522 522 } 523 523 … … 598 598 else { 599 599 &build_gs3_configuration($target_language_code, \%source_file_key_to_text_mapping, \%target_file_key_to_text_mapping, 600 \%source_file_key_to_gti_comment_mapping, \%target_file_key_to_gti_comment_mapping );600 \%source_file_key_to_gti_comment_mapping, \%target_file_key_to_gti_comment_mapping, 1); 601 601 } 602 602 &log_message("Number of source chunks: " . scalar(keys(%source_file_key_to_text_mapping))); … … 1064 1064 my $target_chunk_last_update_date = $target_file_key_to_last_update_date_mapping->{$chunk_key}; 1065 1065 1066 # print "key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n"; 1067 1066 # print "key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n"; 1067 1068 1068 if (defined($target_chunk_last_update_date) && &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date)) { 1069 1069 # &log_message("Chunk with key $chunk_key needs updating."); 1070 # &log_message("key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n"); 1070 1071 push(@target_file_keys_requiring_updating, $chunk_key); 1071 1072 } … … 2022 2023 { 2023 2024 my ($target_language_code, $source_files_key_to_text_mapping, $target_files_key_to_text_mapping, 2024 $source_files_key_to_gti_comment_ mapping, $target_files_key_to_gti_comment_mapping) = @_;2025 $source_files_key_to_gti_comment_or_last_updated_mapping, $target_files_key_to_gti_comment_or_last_updated_mapping, $get_gti_comments_not_last_updated) = @_; 2025 2026 2026 2027 my $source_file_directory = "greenstone3"; # my $source_file_directory = &util::filename_cat("WEB-INF","classes"); … … 2036 2037 my %source_file_key_to_line_mapping = &build_key_to_line_mapping(\@source_file_lines, $translation_file_type); 2037 2038 my %source_file_key_to_text_mapping = &build_key_to_text_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type); 2038 my %source_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type); 2039 2039 #my %source_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type); 2040 2041 my %source_file_key_to_gti_comment_or_last_updated_mapping; 2042 if($get_gti_comments_not_last_updated) { 2043 %source_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type); 2044 } else { 2045 %source_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_last_update_date_mapping($source_file, \@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type); 2046 } 2047 2040 2048 my $target_file = &util::filename_cat($source_file_directory, $interface_file_key."_".$target_language_code.".properties"); 2041 2049 my @target_file_lines = &read_file_lines(&util::filename_cat($gsdl_root_directory, $target_file)); 2042 2050 my %target_file_key_to_line_mapping = &build_key_to_line_mapping(\@target_file_lines, $translation_file_type); 2043 2051 my %target_file_key_to_text_mapping = &build_key_to_text_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type); 2044 my %target_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type); 2052 #my %target_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type); 2053 2054 my %target_file_key_to_gti_comment_or_last_updated_mapping; 2055 if($get_gti_comments_not_last_updated) { 2056 %target_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type); 2057 } else { 2058 %target_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_last_update_date_mapping($target_file, \@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type); 2059 } 2045 2060 2046 2061 … … 2059 2074 my $global_chunk_key = "$interface_file_key.$chunk_key"; 2060 2075 $source_files_key_to_text_mapping->{$global_chunk_key} = $source_file_key_to_text_mapping{$chunk_key}; 2061 $source_files_key_to_gti_comment_ mapping->{$global_chunk_key} = $source_file_key_to_gti_comment_mapping{$chunk_key};2076 $source_files_key_to_gti_comment_or_last_updated_mapping->{$global_chunk_key} = $source_file_key_to_gti_comment_or_last_updated_mapping{$chunk_key}; 2062 2077 2063 2078 if (defined $target_file_key_to_text_mapping{$chunk_key}) { 2064 2079 $target_files_key_to_text_mapping->{$global_chunk_key} = $target_file_key_to_text_mapping{$chunk_key}; 2065 $target_files_key_to_gti_comment_ mapping->{$global_chunk_key} = $target_file_key_to_gti_comment_mapping{$chunk_key};2080 $target_files_key_to_gti_comment_or_last_updated_mapping->{$global_chunk_key} = $target_file_key_to_gti_comment_or_last_updated_mapping{$chunk_key}; 2066 2081 } 2067 2082 }
Note:
See TracChangeset
for help on using the changeset viewer.