diff options
author | Andras Timar <timar@fsf.hu> | 2011-03-08 22:48:09 +0100 |
---|---|---|
committer | Andras Timar <timar@fsf.hu> | 2011-03-08 22:53:50 +0100 |
commit | 9849827a5b8e9c2189f236b452a58eaae95668c6 (patch) | |
tree | d168c3b5ed3cc000a75efd9a2bae1fa38fc9ad24 /l10ntools/source | |
parent | 1acfb268fdcd18894f04216983fda863f8f6f75e (diff) |
adapt localize to LibreOffice directory structure
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/localize.cxx | 66 | ||||
-rw-r--r-- | l10ntools/source/srciter.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/treeconfig.cxx | 12 |
3 files changed, 74 insertions, 12 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 94c06e626e8f..9d8da0ebba7c 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -122,6 +122,56 @@ const char *PositiveList[] = { "NULL" }; +const char *ModuleList[] = { + "accessibility", + "avmedia", + "basctl", + "basic", + "chart2", + "connectivity", + "crashrep", + "cui", + "dbaccess", + "desktop", + "editeng", + "extensions", + "filter", + "forms", + "formula", + "fpicker", + "framework", + "helpcontent2", + "instsetoo_native", + "mysqlc", + "officecfg", + "padmin", + "readlicense_oo", + "reportbuilder", + "reportdesign", + "sc", + "scaddins", + "sccomp", + "scp2", + "sd", + "sdext", + "setup_native", + "sfx2", + "shell", + "starmath", + "svl", + "svtools", + "svx", + "sw", + "swext", + "sysui", + "ucbhelper", + "uui", + "vcl", + "wizards", + "xmlsecurity", + "NULL", +}; + const char PRJ_DIR_NAME[] = "prj"; const char DLIST_NAME[] = "d.lst"; @@ -263,8 +313,16 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel() bool skipProject( ByteString sPrj ) { - static const ByteString READLICENSE( "readlicense" ); - return sPrj.EqualsIgnoreCaseAscii( READLICENSE ); + int nIndex = 0; + bool bReturn = TRUE; + ByteString sModule( ModuleList[ nIndex ] ); + while( !sModule.Equals( "NULL" ) && bReturn ) { + if( sPrj.Equals ( sModule ) ) + bReturn = FALSE; + nIndex++; + sModule = ModuleList[ nIndex ]; + } + return bReturn; } /*****************************************************************************/ @@ -937,9 +995,9 @@ int _cdecl main( int argc, char *argv[] ) { string curRepository; if( has_minor_ext ) - curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext; + curRepository = string( Export::GetEnv("SRC_ROOT") ) + "/" + *iter + minor_ext; else - curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; + curRepository = string( Export::GetEnv("SRC_ROOT") ) + "/" + *iter; cout << "Localizing repository " << curRepository << "\n"; SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx index eb5d78f775af..6ec75336cf52 100644 --- a/l10ntools/source/srciter.cxx +++ b/l10ntools/source/srciter.cxx @@ -70,7 +70,9 @@ void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory ) static rtl::OUString WCARD4 ( RTL_CONSTASCII_USTRINGPARAM("common") ); static rtl::OUString WCARD5 ( RTL_CONSTASCII_USTRINGPARAM("unxmac") ); static rtl::OUString WCARD6 ( RTL_CONSTASCII_USTRINGPARAM("unxubt") ); - static rtl::OUString WCARD7 ( RTL_CONSTASCII_USTRINGPARAM(".svn") ); + static rtl::OUString WCARD7 ( RTL_CONSTASCII_USTRINGPARAM(".git") ); + static rtl::OUString WCARD8 ( RTL_CONSTASCII_USTRINGPARAM("clone") ); + static rtl::OUString WCARD9 ( RTL_CONSTASCII_USTRINGPARAM("install") ); if( sDirName.indexOf( WCARD1 , 0 ) > -1 || @@ -79,7 +81,9 @@ void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory ) sDirName.indexOf( WCARD4 , 0 ) > -1 || sDirName.indexOf( WCARD5 , 0 ) > -1 || sDirName.indexOf( WCARD6 , 0 ) > -1 || - sDirName.indexOf( WCARD7 , 0 ) > -1 + sDirName.indexOf( WCARD7 , 0 ) > -1 || + sDirName.indexOf( WCARD8 , 0 ) > -1 || + sDirName.indexOf( WCARD9 , 0 ) > -1 ) return; //printf("**** %s \n", OUStringToOString( sDirName , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); diff --git a/l10ntools/source/treeconfig.cxx b/l10ntools/source/treeconfig.cxx index 9f02ff80ddc8..2b27e50dd48b 100644 --- a/l10ntools/source/treeconfig.cxx +++ b/l10ntools/source/treeconfig.cxx @@ -22,7 +22,7 @@ namespace transex3 bool Treeconfig::parseConfig(){ - string source_config_file = string( static_cast<ByteString>( Export::GetEnv("SOURCE_ROOT_DIR") ).GetBuffer() ); + string source_config_file = string( static_cast<ByteString>( Export::GetEnv("SRC_ROOT") ).GetBuffer() ); if( source_config_file.empty() ) { cerr << "Error: no suitable environment set?!?"; @@ -50,13 +50,13 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){ string pwd; string guessedRepo; Export::getCurrentDir( pwd ); - string source_root = Export::GetEnv( "SOURCE_ROOT_DIR" ); + string source_root = Export::GetEnv( "SRC_ROOT" ); string solarsrc = Export::GetEnv( "SOLARSRC" ); string partial; // if we are inside of a repository root then active it otherwise let the app handle the return! string::size_type pos = pwd.find_first_of( source_root ); - if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SOURCE_ROOT_DIR + if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SRC_ROOT partial = pwd.substr( pos + source_root.length() +1 , pwd.length()); string::size_type nextPart = partial.find_first_of( "/" ); if( nextPart != string::npos ) @@ -64,7 +64,7 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){ else guessedRepo = partial; } - else // I am NOT within SOURCE_ROOT_DIR + else // I am NOT within SRC_ROOT hasPath = true; if( isPresent ) @@ -94,7 +94,7 @@ bool Treeconfig::getActiveRepositories( vector<string>& active_repos ){ if( !guessedRepo.empty() ){ active_repos.push_back( guessedRepo ); // add myrepo } - return hasPath; // are we deep inside of a source tree or outside of SOURCE_ROOT_DIR? + return hasPath; // are we deep inside of a source tree or outside of SRC_ROOT? } void Treeconfig::getCurrentDir( string& dir ) @@ -109,7 +109,7 @@ void Treeconfig::getCurrentDir( string& dir ) bool Treeconfig::isConfigFilePresent() { - string config_file = Export::GetEnv( "SOURCE_ROOT_DIR" ); + string config_file = Export::GetEnv( "SRC_ROOT" ); config_file += "/source_config"; struct stat status; |