diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-06-17 13:01:23 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-06-17 13:01:23 +0000 |
commit | fddf90c5e9c61a4b44592f195b3f075a80cd4815 (patch) | |
tree | a4534fdd2864b4079ce438ff5ee3e27eb9075ed6 /desktop | |
parent | efc5f86a712aafe37676147faccaee5a54f0bc7e (diff) |
INTEGRATION: CWS mmt1 (1.8.102); FILE MERGED
2005/06/14 13:01:18 dv 1.8.102.1: #123610# Improved language support
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/win32/source/setup/setup.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp index c742d9150b3a..d0bd49656568 100644 --- a/desktop/win32/source/setup/setup.cpp +++ b/desktop/win32/source/setup/setup.cpp @@ -2,9 +2,9 @@ * * $RCSfile: setup.cpp,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: vg $ $Date: 2005-02-24 16:31:36 $ + * last change: $Author: rt $ $Date: 2005-06-17 14:01:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -522,20 +522,30 @@ boolean SetupAppX::ChooseLanguage( long& rLanguage ) LANGID nUserDefLang = GetUserDefaultLangID(); LANGID nSysDefLang = GetSystemDefaultLangID(); + int nUserPrimary = PRIMARYLANGID( nUserDefLang ); + int nSysPrimary = PRIMARYLANGID( nSysDefLang ); + long nUserIndex = -1; + long nUserPrimIndex = -1; long nSystemIndex = -1; + long nSystemPrimIndex = -1; long nParamIndex = -1; for ( long i=0; i<GetLanguageCount(); i++ ) { long nLanguage = GetLanguageID( i ); + int nPrimary = PRIMARYLANGID( nLanguage ); GetLanguageName( nLanguage, sString ); Log( TEXT( " Info: found Language: %s\r\n" ), sString ); if ( nLanguage == nUserDefLang ) nUserIndex = i; + if ( nPrimary == nUserPrimary ) + nUserPrimIndex = i; if ( nLanguage == nSysDefLang ) nSystemIndex = i; + if ( nPrimary == nSysPrimary ) + nSystemPrimIndex = i; if ( m_nLanguageID && ( nLanguage == m_nLanguageID ) ) nParamIndex = i; } @@ -555,11 +565,21 @@ boolean SetupAppX::ChooseLanguage( long& rLanguage ) Log( TEXT( "Info: Found user default language.\r\n" ) ); rLanguage = GetLanguageID( nUserIndex ); } + else if ( nUserPrimIndex != -1 ) + { + Log( TEXT( "Info: Found user default primary language.\r\n" ) ); + rLanguage = GetLanguageID( nUserPrimIndex ); + } else if ( nSystemIndex != -1 ) { Log( TEXT( "Info: Found system default language.\r\n" ) ); rLanguage = GetLanguageID( nSystemIndex ); } + else if ( nSystemPrimIndex != -1 ) + { + Log( TEXT( "Info: Found system default primary language.\r\n" ) ); + rLanguage = GetLanguageID( nSystemPrimIndex ); + } else { Log( TEXT( "Info: Use default language from ini file.\r\n" ) ); |