home *** CD-ROM | disk | FTP | other *** search
-
- ''/*********************************************************************
- ''
- '' Module Name: language.lss
- ''
- '' Module Code: TOOLKIT
- ''
- '' Author: JMDonohue
- '' Creation Date: May 15, 1995
- ''
- '' Copyright Lotus Development Corporation, (c) 1995
- ''
- ''
- ''
- '' Description:
- '' Lotus script file for language processing in common install
- ''
- ''
- '' Additional authors:
- ''
- '' Change History:
- '' $Log: //CIT/VOL1/CFLOG/logfiles/cominst/toolkit/language.l@s $
- ''
- '' Rev 1.45 17 Jul 1996 13:19:50 jdonohue
- '' Removed underscore from Chinese directory names
- ''
- '' Rev 1.44 16 Jul 1996 11:02:48 jdonohue
- '' Chinese split into Simplified (CH) and Traditional (ZH) per CKT
- ''
- '' Rev 1.43 04 Jun 1996 13:53:16 jdonohue
- '' Ref SPR: BODN35QEPV
- '' Changed acronym for Pseudo builds from "PB" to "PD"
- ''
- '' Rev 1.42 24 Apr 1996 15:33:14 jdonohue
- '' Added phony "PB" language acronym, "Pseudo" directory for pseudo-language install
- ''
- '' Rev 1.41 17 Apr 1996 15:46:10 jdonohue
- '' Clean up comments
- ''
- '' Rev 1.40 01 Apr 1996 09:04:52 jdonohue
- '' Added functions MarkLanguageSubdir and Lot_FixupLanguageDirectories to support
- '' new method of MLC handling wih revised C function FRefreshLanguageSource
- ''
- '' Rev 1.39 01 Mar 1996 09:25:32 jdonohue
- '' Don't use version major/minor and call C function AddLanguageToRegistry in
- '' AddRegistryLanguage. This should eliminate delimiter problem in German, etc
- ''
- '' Rev 1.38 01 Feb 1996 15:23:44 cmoy
- '' HISHI: Merged FE changes
- ''
- '' Rev 1.37 11 Dec 1995 13:59:32 jdonohue
- '' Obsoleted functions RefreshLanguageSourceDirectories and
- '' MarkSourceLanguageSubdir
- ''
- '' Rev 1.36 27 Oct 1995 15:10:56 jdonohue
- '' Popup Language Install Message only for first product (suite or single prod)
- ''
- '' Rev 1.35 Oct 24 1995 16:56:32 cmoy
- '' removed eof char
- ''
- '' Rev 1.34 16 Oct 1995 10:54:30 jdonohue
- '' Removed high-bit (non ASCII) characters
- ''
- '' Rev 1.33 26 Sep 1995 16:35:46 jdonohue
- '' Removed extraneous line
- ''
- '' Rev 1.32 26 Sep 1995 16:14:56 jdonohue
- '' Replace C function FindRegistryLanguage with script function
- '' Local function IsLanguageInstalled has product name, version arguments
- '' PopupLanguageInstallMessage has product name as argument, not language acrony
- '' Added sub InitLanguages that records install kind for global and products
- '' Obsolete symbol SYM_INSTALLED_LANGUAGES$
- ''
- '' Rev 1.31 21 Sep 1995 15:11:08 jdonohue
- ''
- '' Changed 0 to FALSE
- ''
- '' Rev 1.30 13 Sep 1995 08:01:46 jdonohue
- '' Removed error case from AddRegistryLanguage
- ''
- '' Rev 1.29 12 Sep 1995 11:55:32 jdonohue
- '' Added PopupLanguageInstallMessage for language install message
- ''
- '' Rev 1.28 11 Sep 1995 17:00:04 jdonohue
- '' No language install for distribution case
- ''
- '' Rev 1.27 24 Aug 1995 16:21:50 jdonohue
- '' Use string literal for language name in language install message
- ''
- '' Rev 1.26 21 Aug 1995 15:41:30 amontalv
- '' Put name of registry keys into globals.lss
- ''
- '' Rev 1.25 17 Aug 1995 15:02:54 jdonohue
- '' Added functions to handle node install of server secondary language
- ''
- '' Rev 1.24 15 Aug 1995 10:33:26 jdonohue
- '' Create registry language keys for language install if necessary
- ''
- '' Rev 1.23 14 Aug 1995 13:55:34 jdonohue
- '' Don't set language install for server install from registry values
- ''
- '' Rev 1.22 11 Aug 1995 12:58:50 jdonohue
- '' Language install if not primary language
- '' Added function IsLanguageInstalled
- ''
- '' Rev 1.21 10 Aug 1995 10:54:58 jdonohue
- '' Changed language install message box handling
- ''
- '' Rev 1.20 10 Aug 1995 07:50:52 jdonohue
- '' Switched arguments for language install message
- ''
- '' Rev 1.19 04 Aug 1995 15:17:48 jdonohue
- '' Made Lot_SetLanguageDirectory PUBLIC
- ''
- '' Rev 1.18 04 Aug 1995 11:57:08 jdonohue
- '' Fixed bug rewriting registry languages on reinstall
- ''
- '' Rev 1.17 25 Jul 1995 13:38:46 jdonohue
- '' Allow user to exit language install
- ''
- '' Rev 1.16 21 Jul 1995 08:13:38 jdonohue
- '' Added language acronyms from ccstr header
- ''
- '' Rev 1.15 20 Jul 1995 15:00:14 jdonohue
- '' Only pop up message box for language install
- ''
- '' Rev 1.14 18 Jul 1995 12:39:02 jdonohue
- '' Use standard Lotus Install title for language/reinstall message box
- ''
- '' Rev 1.13 12 Jul 1995 16:58:12 jdonohue
- '' Made Lot_SetLanguageDirectory more robust
- ''
- '' Rev 1.12 21 Jun 1995 14:02:00 jdonohue
- '' Creates installed and default language keys/values if necessary
- ''
- '' Rev 1.11 09 Jun 1995 16:45:58 jdonohue
- '' Lot_SetLanguageDirectory returns blank if language acronym blank
- ''
- '' Rev 1.10 05 Jun 1995 16:37:28 amontalv
- '' Made changes for migrating to LotusScript version 3.0.37.
- ''
- '' Rev 1.9 26 May 1995 15:33:22 jdonohue
- '' Exits initlanguage of product name or version not supplied
- ''
- '' Rev 1.8 24 May 1995 12:26:56 jdonohue
- '' Fixed chapter finding logic
- ''
- '' Rev 1.7 22 May 1995 11:03:50 jdonohue
- '' Made IsInstallLanguageSection local function
- ''
- '' Rev 1.6 19 May 1995 15:16:00 jdonohue
- '' Added product number argument to SetLanguageSectionsOn
- ''
- '' Rev 1.5 19 May 1995 14:56:26 jdonohue
- '' Added functions to turn language sections on, and to retrieve language subdir
- ''
- '' Rev 1.4 18 May 1995 15:37:06 jdonohue
- '' Added function to update registry installed languages
- ''
- '' Rev 1.3 18 May 1995 13:32:54 jdonohue
- '' Added function to generate language subdirectory
- ''
- '' Rev 1.2 18 May 1995 10:51:38 jdonohue
- '' Changed InitLanguage to be called by clients in XXX.LSS, e.g.
- ''
- '' Rev 1.1 17 May 1995 08:27:48 jdonohue
- '' Changed upgrade logic -- no message
- ''
- '' Rev 1.0 16 May 1995 17:12:46 jdonohue
- '' Initial Revision
- ''
- ''----------------------------------------------------------------------
- '' Date Vers. Pgmr SPR# Change
- ''----------------------------------------------------------------------
- '' 05-15-95 0001 JMD Initial
- ''
- ''----------------------------------------------------------------------
- ''
- ''*********************************************************************/
-
- '**************************************************************************
- '******************************* Windows API's **************************
- '**************************************************************************
-
- USE "RESOURCE"
- USE "GLOBALS"
- USE "SHARE"
- OPTION DECLARE
-
- CONST LANGKEYWORD$="LANG"
- DIM LanguagesInit AS INTEGER
- DIM LanguageDirectorySymbolList LIST AS STRING
- PUBLIC SrcDirResetFlag AS INTEGER 'Lets us know we've reset SYM_STF_BASEDIR
- 'for a node install in a secondary server
- 'language (!)
-
- '**************************C CALLOUT PROTOTYPES*************************
-
- 'OBSOLETE: !!SYM_INSTALLED_LANGUAGES$ symbol not used JMD@
- 'OBSOLETE: !! Should delete from bldcui C function JMD@
- 'DECLARE PUBLIC FUNCTION FindRegistryLanguages LIB "msshlstf.dll" _
- ' ALIAS "_FindRegistryLanguages@20" (ByVal szAppName$, ByVal VerMajor%, _
- ' ByVal VerMinor%, ByVal szInstalled$, ByVal nInstalled&) AS INTEGER
- DECLARE PUBLIC FUNCTION AddLanguageToRegistry LIB "msshlstf.dll" _
- ALIAS "_AddLanguageToRegistry@16" (ByVal szAppName$, ByVal VerMajor%, _
- ByVal VerMinor%, ByVal szLangKW$ ) AS LONG
- DECLARE PUBLIC FUNCTION FRefreshLanguageSource LIB "lcomstf.dll" _
- ALIAS "_FRefreshLanguageSource@12" (ByVal szSymbol$, ByVal szLangKW$, ByVal Flag% ) AS INTEGER
-
- DECLARE PUBLIC SUB InitLanguages(szProductName$, szProductVersion$, prodno%)
- DECLARE PUBLIC SUB InitLanguage(szProductName$, szProductVersion$, _
- szInstallKind$, szLanguageSubdir$)
- DECLARE PUBLIC SUB SetLanguageSubdir( szTarget$, szSource$ )
- DECLARE PUBLIC SUB AddRegistryLanguage(szProductName$, szProductVersion$)
- DECLARE PUBLIC SUB Lot_SetLanguageSectionsOn (ProdNo%)
- DECLARE PUBLIC FUNCTION Lot_SetLanguageDirectory(szLanguageAcronym$) AS STRING
- DECLARE PUBLIC SUB MarkLanguageSubdir(szSubdirSymbol$)
- DECLARE PUBLIC SUB Lot_FixupLanguageDirectories
- DECLARE PUBLIC FUNCTION IsServerSecondaryLanguage AS INTEGER
- DECLARE PUBLIC SUB PopupLanguageInstallMessage( lang$)
-
- '** Private functions
- DECLARE FUNCTION IsInstallLanguageSection( szSectionKeyword$) AS INTEGER
- DECLARE FUNCTION IsLanguageInstalled(szProductName$, szProductVersion$) AS INTEGER
- DECLARE FUNCTION FindRegistryLanguages(szProductName$, szProductVersion$) AS STRING
-
- PUBLIC SUB InitLanguages(szProductName$, szProductVersion$, prodno%)
- '*************************************************************************
- '** Purpose: Finds out the installed languages and determines the nature
- '** of the install. If not running automated, displays a message box for
- '** language install; for an upgrade or a reinstall, just continues
- '** Sets symbols for install kind for install and for individual products in
- '** Suite
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** szProductName$ Product name for registry, e.g., "Approach"
- '** szProductVersion$ Product version for registry, e.g., "2.1"
- '** prodno% Product number from toolkit
- '**
- '** Obtains values for the following global symbols:
- '** SYM_INSTALL_LANGUAGE$
- '** Sets values for the following global symbols:
- '** SYM_INSTALL_KIND$
- '** SYM_INSTALL_KINDS$ (list)
- '**
- '*************************************************************************
- DIM szInstallKind$, szDummy$
- DIM network$
- network$ = GetSymbolValue(SYM_NETWORK$)
- InitLanguage szProductName$, szProductVersion$, szInstallKind$, szDummy$
- '' No language install for server or distribution
- IF network$ <> gSTANDARD AND network$ <> gNODE THEN
- szInstallKind$ = "SERVER"
- END IF
- ' Set the overall install kind based on first product (suite case)
- IF prodno% = 1 THEN SetSymbolValue SYM_INSTALLKIND$, szInstallKind$
- ' Set the product install kinds for client use in scripts
- SetListItem SYM_INSTALLKINDS$, prodno%, szInstallKind$
- '** Inform the user what's happening (only for product 1 (suite or single))
- IF prodno% <> 1 THEN EXIT SUB
- IF szInstallKind$ = gLANGUAGEINSTALL$ THEN _
- PopupLanguageInstallMessage(LdString(SID_123)) '** GEMINI
- END SUB
-
-
- PUBLIC SUB InitLanguage(szProductName$, szProductVersion$, _
- szInstallKind$, szLanguageSubdir$)
- '*************************************************************************
- '** Purpose: Finds out the installed languages and determines the nature
- '** of the install. If not running automated, displays a message box for
- '** language install; for an upgrade or a reinstall, just continues
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** szProductName$ Product name for registry, e.g., "Approach"
- '** szProductVersion$ Product version for registry, e.g., "2.1"
- '** Returns:
- '** szInstallKind$ One of: gUPGRADE
- '** gREINSTALL
- '** gLANGUAGEINSTALL
- '** szLanguageSubdir$ Subdirectory name for other than primary language
- '** files, e.g., "Francais"
- '**
- '** Obtains values for the following global symbols from resources:
- '** SYM_INSTALL_LANGUAGE$
- '**
- '** Sets the following global symbols:
- '** SYM_LANGUAGE_SUBDIR$
- '*************************************************************************
- DIM i%, dbl#, s$, lang$, network$
- DIM szInstalled$, nInstalled&
- nInstalled = 128 'Size of installed languages string
-
- szInstallKind$ = gUPGRADE$ 'Default
- '** Set language of install and its subdirectory (once only)
- if LanguagesInit = 0 Then
- s$ = LdString(SID_LANGUAGE)
- SetSymbolValue SYM_INSTALL_LANGUAGE$, s$
- s$ = Lot_SetLanguageDirectory(s$)
- SetSymbolValue SYM_LANGUAGE_SUBDIR$, s$
- LanguagesInit = 1
- End if
-
- IF szProductName$ = "" THEN EXIT SUB
- IF szProductVersion$ = "" THEN EXIT SUB
- network$ = GetSymbolValue(SYM_NETWORK$)
- ' MLC Does not apply to distribution, and server determines it from
- ' cinstall.ini
- IF network$ = gSERVER$ THEN EXIT SUB
- IF network$ = gDISTRIBUTION$ THEN EXIT SUB
- szInstalled$ = STRING$(nInstalled&, 0)
- '** Find the list of installed languages for product/version
- szInstalled$ = FindRegistryLanguages(szProductName$, szProductVersion$)
- szInstalled$ = NullTrim(szInstalled$)
- if szInstalled$ = "" Then
- '** Product/version not installed == Upgrade
- SetSymbolValue SYM_INSTALLKIND$, gUPGRADE$
- szInstallKind$ = gUPGRADE$
- szLanguageSubdir$ = "" '** Goes in with content
- EXIT Sub
- end if
- '** Find out if our language is primmary
- lang$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
- s$ = Lot_GetNthFieldFromIniString(szInstalled$, 1, "")
- s$ = LEFT(s$, 2) ' Paranoia
- if s$ = lang$ then
- '** Found the primary language and the version, must be reinstall
- szInstallKind$ = gREINSTALL$
- szLanguageSubdir$ = "" '** Goes in with content
- EXIT Sub
- end if
- '** Got this far, we must be language install, set the directory and kind
- szLanguageSubdir$ = GetSymbolValue (SYM_LANGUAGE_SUBDIR$)
- szInstallKind$ = gLANGUAGEINSTALL$
-
- END SUB
-
- '**************************************************************************
- '** SUB PopupLanguageInstallMessage( szProductName$)
- '** Purpose: Displays a dialog telling the user a language install is
- '** occurring and requesting confirmation; if answered no, exits install
- '**
- '** Author: JMDonohue
- '** Arguments: szProductName$ Product Name
- '**
- '*************************************************************************
- PUBLIC SUB PopupLanguageInstallMessage( szProductName$)
- DIM msg$, i%, s$, title$, rc&
-
- '** Set the standard title for install messages
- title$ = LdString(SID_TKT_STD_TITLE)
- msg$ = LdString(SID_LANGUAGEINSTALL_MSG)
- i% = instr(msg$,"%s")
- s$ = mid$(msg$, 1, i%-1) + szProductName$ + mid$(msg$, i%+2)
- if GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN EXIT SUB
- DO
- rc& = DoMsgBox(s$, title$, MB_YESNO)
- if CINT(rc&) = IDYES THEN
- EXIT SUB
- ELSE
- QUIT
- END IF
- LOOP
- END SUB
-
- '**************************************************************************
- '** FUNCTION IsInstallLanguageSection( szSectionKeyword$) AS INTEGER
- '** Purpose: Determines if section is part of a language pack for the language
- '** currently being installed by matching the ending of the name with the
- '** keyword "LANG??" where "??" is a two character acronym for the language
- '**
- '** Author: JMDonohue
- '** Arguments: szSectionKeyword$ keyword for section from .inf file
- '** Returns: TRUE if a section for the language we are installing
- '** Uses the following global symbols:
- '** SYM_INSTALL_LANGUAGE$
- '**
- '*************************************************************************
- FUNCTION IsInstallLanguageSection( szSectionKeyword$) AS INTEGER
- DIM LangKey$, LangAcronym$, InstallLanguage$, s$, leng%
- s$ = szSectionKeyword$
- leng% = Len(s$)
- if leng% < 6 Then
- IsInstallLanguageSection = FALSE
- Else
- LangKey$ = UCase$(Right$(s$,6))
- LangAcronym$ = Right$(LangKey$,2)
- InstallLanguage$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
-
- LangKey$ = Left$(LangKey$,4)
- If LangKey$ = LANGKEYWORD$ Then
- If LangAcronym$ = InstallLanguage$ Then
- IsInstallLanguageSection = TRUE
- Else
- IsInstallLanguageSection = FALSE
- End if
- Else
- IsInstallLanguageSection = FALSE
- End if
- End if
- END FUNCTION
-
-
- FUNCTION IsLanguageInstalled(szProductName$, szProductVersion$) AS INTEGER
- '**************************************************************************
- '** Purpose: Determines if the current language is already installed by
- '** examining the registry entries for product/version
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** szProductName$ Product name for registry, e.g., "Approach"
- '** szProductVersion$ Product version for registry, e.g., "2.1"
- '**
- '** Returns: Index of language, or 0 if not installed
- '** Uses the following global symbols:
- '** SYM_INSTALL_LANGUAGE$
- '**
- '*************************************************************************
- DIM lang$, installed$, s$, i%
-
- IsLanguageInstalled = 0
- i% = 1
- lang$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
- installed$ = FindRegistryLanguages(szProductName$, szProductVersion$)
- if installed$ = "" THEN EXIT FUNCTION
- DO
- s$ = Lot_GetNthFieldFromIniString(installed$ , i%, "")
- s$ = LEFT(s$, 2) ' Paranoia
- if s$ = lang$ then
- IsLanguageInstalled = i%
- EXIT FUNCTION
- end if
- i% = i% + 1
- LOOP WHILE (s$<>"")
- END FUNCTION
-
-
- '**************************************************************************
- '** SUB SetLanguageSubdir( szTarget$, szSource$ )
- '** Purpose: For a language install, sets the value of target symbol to the
- '** value of source symbol with the language subdirectory appended
- '**
- '** Author: JMDonohue
- '** Arguments: szTarget$ Target symbol for language subdirectory
- '** szSource$ Symbol for base component directory
- '** Returns:
- '** Uses the following global symbols:
- '** SYM_LANGUAGE_SUBDIR$
- '**
- '*************************************************************************
- PUBLIC SUB SetLanguageSubdir( szTarget$, szSource$ )
- DIM s$
- s$ = GetSymbolValue(SYM_LANGUAGE_SUBDIR$) + "\"
- s$ = MakePath(GetSymbolValue(szSource$), s$)
- SetSymbolValue szTarget$, s$
- END SUB
-
-
- '*************************************************************************
- '** SUB AddRegistryLanguage(szProductName$, szProductVersion$)
- '** Purpose: When a language install completes, updates the list of
- '** installed languages for the product/version; for a first time install,
- '** create the appropriate key and value
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** szProductName$ Product name for registry, e.g., "Approach"
- '** szProductVersion$ Product version for registry, e.g., "2.1"
- '** Returns: TRUE if successful
- '**
- '**************************************************************************
- PUBLIC SUB AddRegistryLanguage(szProductName$, szProductVersion$)
- DIM szLangKW$, Ret&
- DIM VerMajor%, VerMinor%, dbl#
- DIM szkey$, keyvalue$, s$
-
- IF szProductName$ = "" THEN EXIT SUB
- IF szProductVersion$ = "" THEN EXIT SUB
- szkey$ = gREGLOTUS + szProductName$ + "\" + szProductVersion$ + "\Languages"
- szLangKW$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
-
- '** Create the key if it doesn't exist or add to existing value
- IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szkey$) = FALSE THEN
- Ret& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szkey$)
- 'if Ret& <> 0 then print "Could not create registry key " szkey$
- '** New product/version, create language registry values
- keyvalue$ = "Installed"
- Ret& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey$, keyvalue$, _
- REG_SZ, szLangKW$, lenbp(szLangKW$)+1)
- 'if Ret& <> 0 then print "Could not create registry value " szkey$
- keyvalue$ = "Default"
- Ret& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey$, keyvalue$, _
- REG_SZ, szLangKW$, lenbp(szLangKW$)+1)
- 'if Ret& <> 0 then print "Could not create registry value " szkey$
- ELSE
- '** Add the current language to the "Installed" key in registry if not already
- '** there
-
- IF IsLanguageInstalled(szProductName$, szProductVersion$) <> 0 THEN EXIT SUB
-
- s$ = FindRegistryLanguages(szProductName$, szProductVersion$)
- s$ = s$ + "," + szLangKW$
- keyvalue$ = "Installed"
- Ret& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey$, keyvalue$, _
- REG_SZ, s$, lenbp(s$)+1)
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '** SUB Lot_SetLanguageSectionsOn (ProdNo%)
- '**
- '** Purpose: Sets language sections for copying (off by default)
- '** Author: Jack Donohue
- '** Arguments: ProdNo% Product number
- '** Returns:
- '*************************************************************************
- PUBLIC SUB Lot_SetLanguageSectionsOn (ProdNo%)
- DIM rc%, keyword$, chapter$, feature$, sym$, Sib$
-
- Sib$ = Lot_GetNextSibling(Str$(ProdNo%), F_NOTHING )
- chapter$ = Lot_GetFirstChild(Str$(ProdNo%), F_NOTHING )
-
- %rem
- If (chapter$ = "") then
- ERROR STFQUIT
- End if
- %endrem
-
- WHILE (chapter$ <> Sib$ )
- '** Traverse all chapters, looking for sections with the language
- '** keyword; if they belong to an installed feature, turn them on
-
- keyword$ = Lot_GetChapterValStr (chapter$, F_KEYWORD)
- If IsInstallLanguageSection(keyword$) = TRUE Then
- feature$ = Left(keyword$, Len(keyword$)-6)
- feature$ = Lot_GetChapterFromKeyword (feature$)
- rc% = Lot_GetChapterValInt (feature$, F_INOROUT)
- If rc% = 1 Then
- rc% = Lot_SetChapterFilesInCopyListInOrOut (chapter$, 1)
- End If
- End If
- '*** Goto next chapter
- chapter$ = Lot_GetNext()
- WEND
- END SUB
-
-
- DIM LANGUAGEDIR LIST AS STRING
-
- '*************************************************************************
- '** PUBLIC FUNCTION Lot_SetLanguageDirectory(szLanguageAcronym$) AS STRING
- '** Purpose: Looks up the directory name corresponding to the two letter
- '** language acronym in internal table
- '**
- '** The acronyms are from the ccstr header file; language directory names
- '** other than those commented need to be supplied
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** szLanguageAcronym$ Language acronym, e.g., "FR"
- '** Returns: Subdirectory string, e.g., "Francais"
- '**************************************************************************
- PUBLIC FUNCTION Lot_SetLanguageDirectory(szLanguageAcronym$) AS STRING
- if LanguagesInit = 0 Then
- '**NOTE: Need to complete this sections, and/or resource it
- '?? Catala: 6 characters [Catala]
- LANGUAGEDIR("AM") = "Amharic"
- LANGUAGEDIR("AR") = "Arabi" 'Arabic
- LANGUAGEDIR("AS") = "Assamese"
- LANGUAGEDIR("AY") = "Aymara"
- LANGUAGEDIR("AZ") = "Azerbaijani"
- LANGUAGEDIR("BE") = "Byelorussian"
- LANGUAGEDIR("BG") = "Bulgarian"
- LANGUAGEDIR("BN") = "Bengali"
- LANGUAGEDIR("BO") = "Tibetan"
- LANGUAGEDIR("CA") = "Catalan"
- 'CKT
- LANGUAGEDIR("CH") = "ChineseS" 'Simplified Chinese
- LANGUAGEDIR("CS") = "Ceska" 'Czech
- LANGUAGEDIR("CY") = "Welsh"
- LANGUAGEDIR("DA") = "Dansk" 'Danish
- LANGUAGEDIR("DE") = "Deutsch" 'German
- LANGUAGEDIR("EL") = "Hellenic" 'Greek
- LANGUAGEDIR("EN") = "English" 'English
- LANGUAGEDIR("EO") = "Esperanto"
- LANGUAGEDIR("ES") = "Espanol" 'Spanish
- LANGUAGEDIR("ET") = "Estonian"
- LANGUAGEDIR("EU") = "Basque"
- LANGUAGEDIR("FA") = "Farsi" 'Farsi
- 'LANGUAGEDIR("FA") = "Persian"
- LANGUAGEDIR("FI") = "Suomi" 'Finnish
- LANGUAGEDIR("FO") = "Faeroese"
- LANGUAGEDIR("FR") = "Francais" 'French
- LANGUAGEDIR("GN") = "Guarani"
- LANGUAGEDIR("GU") = "Gujarati"
- LANGUAGEDIR("HI") = "Hindi"
- LANGUAGEDIR("HR") = "Croatian"
- LANGUAGEDIR("HU") = "Magyar" 'Hungarian
- LANGUAGEDIR("HY") = "Armenian"
- LANGUAGEDIR("IN") = "Indonesian"
- LANGUAGEDIR("IS") = "Icelandic"
- LANGUAGEDIR("IT") = "Italian" 'Italian
- LANGUAGEDIR("IW") = "Hebrew" 'Hebrew
- LANGUAGEDIR("JA") = "Japanese" 'Japanese
- LANGUAGEDIR("JI") = "Yiddish"
- LANGUAGEDIR("KA") = "Georgian"
- LANGUAGEDIR("KK") = "Kazakh"
- LANGUAGEDIR("KM") = "Khmer"
- LANGUAGEDIR("KN") = "Kannada"
- LANGUAGEDIR("KO") = "Korean" 'Korean
- LANGUAGEDIR("KS") = "Kashmiri"
- LANGUAGEDIR("KU") = "Kurdish"
- LANGUAGEDIR("KY") = "Kirghiz"
- LANGUAGEDIR("LA") = "Latin"
- LANGUAGEDIR("LO") = "Lao"
- LANGUAGEDIR("LT") = "Lithuanian"
- LANGUAGEDIR("LV") = "Latvian"
- LANGUAGEDIR("LV") = "Lettish"
- LANGUAGEDIR("MG") = "Malagasy"
- LANGUAGEDIR("MK") = "Macedonian"
- LANGUAGEDIR("ML") = "Malayalam"
- LANGUAGEDIR("MN") = "Mongolian"
- LANGUAGEDIR("MO") = "Moldavian"
- LANGUAGEDIR("MR") = "Marathi"
- LANGUAGEDIR("MY") = "Burmese"
- LANGUAGEDIR("NE") = "Nepali"
- LANGUAGEDIR("NL") = "Nederlan" 'Dutch
- LANGUAGEDIR("NO") = "Norsk" 'Norwegian
- LANGUAGEDIR("OR") = "Oriya"
- LANGUAGEDIR("PA") = "Punjabi"
- LANGUAGEDIR("PL") = "Polski" 'Polish
- LANGUAGEDIR("PS") = "Pashto"
- LANGUAGEDIR("PT") = "Portugue" 'Portuguese
- LANGUAGEDIR("QU") = "Quechua"
- LANGUAGEDIR("RM") = "RhaetoRomanic"
- LANGUAGEDIR("RO") = "Romanian"
- LANGUAGEDIR("RU") = "Russkiy" 'Russian
- LANGUAGEDIR("SA") = "Sanskrit"
- LANGUAGEDIR("SD") = "Sindhi"
- LANGUAGEDIR("SH") = "Serbocroatian"
- LANGUAGEDIR("SI") = "Sinhalese"
- LANGUAGEDIR("SK") = "Slovenci" 'Slovak
- LANGUAGEDIR("SL") = "Slovenian"
- LANGUAGEDIR("SO") = "Somali"
- LANGUAGEDIR("SQ") = "Albanian"
- LANGUAGEDIR("SR") = "Serbian"
- LANGUAGEDIR("SV") = "Svenska" 'Swedish
- LANGUAGEDIR("SW") = "Swahili"
- LANGUAGEDIR("TA") = "Tamil"
- LANGUAGEDIR("TE") = "Telugu"
- LANGUAGEDIR("TG") = "Tajiki"
- LANGUAGEDIR("TH") = "Thai" 'Thai
- LANGUAGEDIR("TI") = "Tigrinya"
- LANGUAGEDIR("TK") = "Turkmen"
- LANGUAGEDIR("TL") = "Tagalog"
- LANGUAGEDIR("TR") = "Turkce" 'Turkish
- LANGUAGEDIR("TT") = "Tatar"
- LANGUAGEDIR("UK") = "Ukrainian"
- LANGUAGEDIR("UR") = "Urdu"
- LANGUAGEDIR("UZ") = "Uzbek"
- LANGUAGEDIR("VI") = "Vietnamese"
- 'CKT
- LANGUAGEDIR("ZH") = "ChineseT" 'Traditional Chinese
- LANGUAGEDIR("PD") = "Pseudo" 'Special for pseudo-language testing
- End if
- if szLanguageAcronym$ = "" then
- Lot_SetLanguageDirectory = ""
- exit function
- end if
- if (ISELEMENT(LANGUAGEDIR(szLanguageAcronym$)) <> 0 ) then
- Lot_SetLanguageDirectory = LANGUAGEDIR(szLanguageAcronym$)
- Else
- Lot_SetLanguageDirectory = ""
- End if
- END FUNCTION
-
-
- CONST FIXUPSOURCE = 1
- CONST FIXUPDEST = 2
- CONST FIXUPBOTH = 3
-
- PUBLIC SUB Lot_FixupLanguageDirectories
- '*************************************************************************
- '** Purpose: Changes the source filepath to include the language subdirectory
- '** This is only required for node install from a server in a secondary
- '** language, since the content files have been installed in subdirectories
- '** Traverses the list of destination path symbols that have been made by
- '** MarkLanguageSubdir and inserts the language subdirectory as the
- '** last path element in the filename
- '** Required fixup:
- '** Standard MLC Install Destination
- '** Server MLC Install Destination
- '** Node MLC Install Destination
- '** Server Secondary Server Language Source
- '**
- '** NOTE: Language install based on FIRST product (or suite)
- '**
- '** Author: JMDonohue
- '**************************************************************************
- DIM Flag%, network$, ret%
- network$ = GetSymbolValue(SYM_NETWORK$)
- IF network$ = gDISTRIBUTION$ THEN EXIT SUB
-
- Flag% = 0
- IF GetListItem(SYM_INSTALLKINDS$, 1) = gLANGUAGEINSTALL$ THEN _
- Flag% = Flag% + FIXUPDEST
- IF IsServerSecondaryLanguage THEN Flag% = Flag% + FIXUPSOURCE
- FORALL sym IN LanguageDirectorySymbolList
- ret% = FRefreshLanguageSource(ListTag(sym), sym, Flag)
- END FORALL
- END SUB
-
- PUBLIC SUB MarkLanguageSubdir(szSubdirSymbol$)
- '*************************************************************************
- '** Purpose: Adds the symbol to a list of subdirectory symbols that must
- '** have a language subdirectory added to the source and/or destination
- '**
- '** Author: JMDonohue
- '** Arguments: szSubdirSymbol$ Language dependent destination directory symbol
- '**************************************************************************
- DIM s$
- s$ = GetSymbolValue(SYM_LANGUAGE_SUBDIR$) + "\"
- if (ISELEMENT(LanguageDirectorySymbolList(szSubdirSymbol$)) = 0 ) then _
- LanguageDirectorySymbolList(szSubdirSymbol$) = s$
- END SUB
-
-
- PUBLIC FUNCTION IsServerSecondaryLanguage AS INTEGER
- '*************************************************************************
- '** FUNCTION IsServerSecondaryLanguage AS INTEGER
- '** Purpose: Determines is the current language is a secondary language on
- '** the server, in which case clients must mark language symbols for
- '** resetting source file locations
- '**
- '** Author: JMDonohue
- '** Arguments:
- '** Returns: TRUE if language is server secondary
- '**************************************************************************
- DIM s$, installini$, proddir$
-
- IsServerSecondaryLanguage = FALSE
- ' If the install directory is not the same as the base product directo
- ' install must be in a language subdirectory
- s$ = GetSymbolValue(SYM_STF_CWDDIR$)
- installini$ = s$ + gINSTALLINI$
- s$ = GetIniKeyString(installini$, "Critical Directories", "INSTDIR")
- proddir$ = GetIniKeyString(installini$, "Critical Directories",_
- Reg_GetProductAcronym(1) + "DIR")
- IF s$ <> proddir$ THEN IsServerSecondaryLanguage = TRUE
-
- END FUNCTION
-
- FUNCTION FindRegistryLanguages(szProductName$, szProductVersion$) AS STRING
- '*************************************************************************
- '** Purpose: Find out what languages have been installed for the product
- '**
- '** Author: JMDonohue
- '** Arguments: szProductName$ Product name in registry
- '** szProductVersion$ Product version in registry
- '**
- '** Returns: List of installed languages
- '**************************************************************************
- DIM szkey$, ret&, nsize&, gbuf$
- FindRegistryLanguages = ""
- szkey$ = gREGLOTUS + szProductName$ + "\" + szProductVersion$ + "\Languages"
- IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szkey$) = FALSE THEN EXIT FUNCTION
- gbuf$=CreateBuffer(256)
- nsize& = Len(gbuf$)
- ret& = Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey$, "Installed", 0, gbuf$, nsize&)
- FindRegistryLanguages = NullTrim(gbuf$)
- gbuf$=""
-
- END FUNCTION
-