summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2011-05-17 18:29:40 +0200
committerAndras Timar <atimar@suse.com>2011-05-17 22:38:55 +0200
commit45942b26d959bcaf8f5422d182074922d2898646 (patch)
tree0caa71a77d1eb226d4099e657378cbedd47b720e /l10ntools
parentd40a49f73ee69f2b04b3b22610420cf6c85df645 (diff)
remove unused functions
Diffstat (limited to 'l10ntools')
-rwxr-xr-xl10ntools/scripts/localize.pl150
1 files changed, 0 insertions, 150 deletions
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index a53ca9caf5e7..53a64d0ca66b 100755
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -324,18 +324,6 @@ sub merge_gsicheck{
}
$sdffile = $tmpfile;
}
-#########################################################
-# find search function
-sub wanted
-{
- my $file = $File::Find::name;
- if( -f $file && $file =~ /.*localize.sdf$/ && !( $file =~ /.*\.svn.*/ ) ) {
- push @sdfparticles , $file;
- if( $bVerbose eq "1" ) { print STDOUT "$file\n"; }
- else { print "."; }
- }
-}
-
sub add_paths
{
my $langhash_ref = shift;
@@ -620,147 +608,9 @@ sub collectfiles{
#print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n";
unlink $localizeSDF , $particleSDF_merged , $my_localize_log;
-
- #sort_outfile( $outputfile );
- #remove_obsolete( $outputfile ) , if $bHasSourceLanguage ne "";
}
#########################################################
-sub remove_obsolete{
- my $outfile = shift;
- my @lines;
- my $enusleftpart;
- my @good_lines;
-
- print STDOUT "### Removing obsolete strings\n";
-
- # Kick out all strings without en-US reference
- if ( open ( SORTEDFILE , "< $outfile" ) ){
- while( <SORTEDFILE> ){
- if( /$sdf_regex/ ){
- my $line = defined $_ ? $_ : '';
- my $language = defined $12 ? $12 : '';
- my $prj = defined $3 ? $3 : '';
- my $file = defined $4 ? $4 : '';
- my $type = defined $6 ? $6 : '';
- my $gid = defined $7 ? $7 : '';
- my $lid = defined $8 ? $8 : '';
- my $plattform = defined $10 ? $10 : '';
- my $helpid = defined $9 ? $9 : '';
-
- my $leftpart = $prj.$gid.$lid.$file.$type.$plattform.$helpid;
-
- if( $language eq "en-US" ){ # source string found, 1. entry
- $enusleftpart = $leftpart;
- push @good_lines , $line;
- }else{
- if( !defined $enusleftpart or !defined $leftpart ){
- print STDERR "BADLINE: $line\n";
- print STDERR "\$enusleftpart = $enusleftpart\n";
- print STDERR "\$leftpart = $leftpart\n";
- }
- if( $enusleftpart eq $leftpart ){ # matching language
- push @good_lines , $line;
- }
- #else{
- # print STDERR "OUT: \$enusleftpart=$enusleftpart \$leftpart=$leftpart \$line=$line\n";
- #}
- }
- }
- }
- close SORTEDFILE;
- } else { print STDERR "ERROR: Can't open file $outfile\n";}
-
- # Write file
- if ( open ( SORTEDFILE , "> $outfile" ) ){
- foreach my $newline ( @good_lines ) {
- print SORTEDFILE $newline;
- }
- close SORTEDFILE;
- } else { print STDERR "ERROR: Can't open file $outfile\n";}
-
-}
-#########################################################
-sub sort_outfile{
- my $outfile = shift;
- print STDOUT "### Sorting ... $outfile ...";
- my @lines;
- my @sorted_lines;
-
-
- #if ( open ( SORTEDFILE , "< $outputfile" ) ){
- if ( open ( SORTEDFILE , "< $outfile" ) ){
- my $line;
- while ( <SORTEDFILE> ){
- $line = $_;
- if( $line =~ /^[^\#]/ ){
- push @lines , $line;
- }
- }
- close SORTEDFILE;
- @sorted_lines = sort {
- my $xa_lang = "";
- my $xa_left_part = "";
- my $xa_right_part = "";
- my $xa_timestamp = "";
- my $xb_lang = "";
- my $xb_left_part = "";
- my $xb_right_part = "";
- my $xb_timestamp = "";
- my $xa = "";
- my $xb = "";
- my @alist;
- my @blist;
-
- if( $a=~ /$sdf_regex/ ){
- $xa_left_part = defined $2 ? $2 : '';
- $xa_lang = defined $12 ? $12 : '';
- $xa_right_part = defined $13 ? $13 : '';
- $xa_left_part = remove_last_column( $xa_left_part );
-
- }
- if( $b=~ /$sdf_regex/ ){
- $xb_left_part = defined $2 ? $2 : '';
- $xb_lang = defined $12 ? $12 : '';
- $xb_right_part = defined $13 ? $13 : '';
- $xb_left_part = remove_last_column( $xb_left_part );
-
-
- }
- if( ( $xa_left_part cmp $xb_left_part ) == 0 ){ # Left part equal
- if( ( $xa_lang cmp $xb_lang ) == 0 ){ # Lang equal
- return ( $xa_right_part cmp $xb_right_part ); # Right part compare
- }
- elsif( $xa_lang eq "en-US" ) { return -1; } # en-US wins
- elsif( $xb_lang eq "en-US" ) { return 1; } # en-US wins
- else { return $xa_lang cmp $xb_lang; } # lang compare
- }
- else {
- return $xa_left_part cmp $xb_left_part; # Left part compare
- }
- } @lines;
-
- if ( open ( SORTEDFILE , "> $outfile" ) ){
- print SORTEDFILE get_license_header();
- foreach my $newline ( @sorted_lines ) {
- print SORTEDFILE $newline;
- #print STDOUT $newline;
- }
- }
- close SORTEDFILE;
- } else { print STDERR "WARNING: Can't open file $outfile\n";}
- print "done\n";
-
-}
-#########################################################
-sub remove_last_column{
- my $string = shift;
- my @alist = split ( "\t" , $string );
- pop @alist;
- return join( "\t" , @alist );
-}
-
-#########################################################
sub rename_language{
my $fallbackhashhash_ref = shift;
my $cur_fallback = shift;