From 54311d2499a8502ea3a827347992c2f4d6e40d31 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 22 Jan 2010 18:50:33 +0100 Subject: cws l10ntools: #i107386# #i107993# #ii107992# #i107991# #i108587# Added some buildtypes , fix for broken localize_sl regarding UPDMINOREXT , pmladeks localize.pl ooo enforcer patch --- transex3/prj/build.lst | 2 +- transex3/scripts/localize.pl | 13 ++++++++++--- transex3/source/localize.cxx | 17 ++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'transex3') diff --git a/transex3/prj/build.lst b/transex3/prj/build.lst index 0017471af134..685686192daf 100644 --- a/transex3/prj/build.lst +++ b/transex3/prj/build.lst @@ -1,4 +1,4 @@ -tr transex3 : tools libxslt berkeleydb LUCENE:lucene NULL +tr transex3 : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL tr transex3 usr1 - all tr_mkout NULL tr transex3\inc nmake - all tr_inc NULL tr transex3\source nmake - all tr_src tr_inc NULL diff --git a/transex3/scripts/localize.pl b/transex3/scripts/localize.pl index 10e8124027b1..0f6a19effc38 100755 --- a/transex3/scripts/localize.pl +++ b/transex3/scripts/localize.pl @@ -78,6 +78,7 @@ my $WIN; my $languages; #my %sl_modules; # Contains all modules where en-US and de is source language my $use_default_date = '0'; +my $force_ooo_module = '0'; my %is_ooo_module; my %is_so_module; my $DELIMITER; @@ -275,7 +276,7 @@ sub check_modules_scm sub is_openoffice_module { my $module = shift; - return "TRUE", if defined $is_ooo_module{ $module }; + return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } ); return ""; } @@ -1114,7 +1115,7 @@ sub parse_options{ my $extract; my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date , 'c' => \$create_dirs , - 'n' => \$no_gsicheck ); + 'n' => \$no_gsicheck , 'o' => \$force_ooo_module ); $outputfile = $sdffile; #print STDOUT "DBG: lang = $languages\n"; @@ -1126,7 +1127,11 @@ sub parse_options{ exit(1); } } - if( $help || !$success || $#ARGV > 1 || ( !$sdffile ) ){ + if( $help ){ + usage(); + exit(0); + } + if( !$success || $#ARGV > 1 || ( !$sdffile ) ){ usage(); exit(1); } @@ -1167,6 +1172,8 @@ sub usage{ print STDERR " -h File with localize.sdf's\n!"; print STDERR " -n No gsicheck\n"; print STDERR " -i Module to merge\n"; + print STDERR " -o force using ooo localization from the l10n module instead of l10n_so; \n"; + print STDERR " useful if the type can't be detected by the .svn tags; \n"; print STDERR " -v Verbose\n"; print STDERR "\nExample:\n"; print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; diff --git a/transex3/source/localize.cxx b/transex3/source/localize.cxx index c82d152cac7e..e23165ee657c 100644 --- a/transex3/source/localize.cxx +++ b/transex3/source/localize.cxx @@ -938,10 +938,25 @@ int _cdecl main( int argc, char *argv[] ) bool hasPwd = treeconfig.getActiveRepositories( repos ); if( hasPwd ) cout << "Found special path!\n"; + string minor_ext; + bool has_minor_ext; + + if( Export::GetEnv("UPDMINOREXT") != NULL ) + { + minor_ext = string( Export::GetEnv("UPDMINOREXT") ); + has_minor_ext = minor_ext.size(); + } + else + has_minor_ext = false; + // localize through all repositories for( vector::iterator iter = repos.begin(); iter != repos.end() ; ++iter ) { - string curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; + string curRepository; + if( has_minor_ext ) + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext; + else + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; cout << "Localizing repository " << curRepository << "\n"; SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); -- cgit