Steven Westwell’s blog

My outlook on a few things of interest to me, and hopefully you.

Posts Tagged ‘Office Communicator’

OCS Localisation (ii)

Posted by Steven Westwell on February 26, 2008

So in my previous post, and over at Modality Systems we began looking at the localisation of Office Communicator 2007 to match the Office 2007 installation.  Over the last week I have updated the script to match the language of the OS.

However, this script is reliant on a task during the build of the client placing a variable into the registry.

Since we are using BDD (forerunner to MDT) and SMS OSD to deploy our client, we have several custom tasks and environment variables available to us during the build.  One of these is the “UILanguage” environment variable which contains the language pack to be installed during the build.  In the scenario we have this variable is populated by the BDD database depending on the role assigned to the particular client being built.

The following line of code writes the registry key that we query, this is run in the context of ztiutility.vbs, as a custom task created in BDD.: 

oShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREClientIdentificationVistaLanguage", oEnvironment.Item("UILanguage"), "Reg_SZ"

During the install applications phase of the build, following the install of both Office Communicator 2007 and the Office Communicator MUI pack, we execute the below code to localise Office Communicator

Dim iRetVal

On Error Resume Next
iRetVal = OCSLoc
WScript.Quit(iRetVal)
On Error Goto 0

Function OCSLoc()Dim iRetVal
Dim UICode
Dim UILang
Dim strComputer
Dim oReg
Dim arrValueNames
Dim arrValueTypes
Dim strKeyPath
Dim i
Dim oShell
Dim FsoObj1

Const HKEY_LOCAL_MACHINE = &H80000001
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7
Const Success = 0
Const Failure = 1

Set FsoObj1 = CreateObject("scripting.filesystemobject")
set File_out=FsoObj1.CreateTextFile("c:logginglocationOCSLocalisation.log")

set oShell = CreateObject("wscript.Shell")

'//set default/flag values
iRetVal = Failure
OfficeCode = 1033

'//----------------------------------------------------------------------------
'// Check for the UI language and apply to OCS
'//----------------------------------------------------------------------------

File_out.writeline("zAZCFG-OCSLanguage: Looking for UI language ID in registry")

'//----------------------------------------------------------------------------
'//This script is executed following deployment from BDD/MDT via SMS OSD
'//During the deployment we tattoo the registry with the "UILanguage" environment variable
'//This is in the format en-US, fr-FR etc...
'//----------------------------------------------------------------------------

UILang = oShell.RegRead("HKEY_LOCAL_MACHINESOFTWAREClientIdentificationVistaLanguage")
'//Capture error
If Err.Number <> 0 Then
File_out.writeline("zAZCFG-OCSLanguage: Office Language Key not found, defaulting to: en-US")
oShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommunicator MUIDefault Language", 1033, "REG_DWORD"
iRetVal = Success

File_out.Close
Set FsoObj1 = Nothing

Exit Function

End if

File_out.writeline("UI Language Identified as: " & UILang)

'//----------------------------------------------------------------------------
'// Convert Language to LCID i.e. en-US -> 1033 for all supported languages
'//----------------------------------------------------------------------------

Select Case UILang
Case "en-US"
UICode = 1033
Case "nl-NL"
UICode = 1043
Case "fr-FR"
UICode = 1036
Case "de-de"
UICode = 1031
Case "it-IT"
UICode = 1040
Case "ja-JP"
UICode = 1041
Case "es-ES"
UICode = 3082
Case "ar-SA"
UICode = 1025
Case "zh-CN"
UICode = 2052
Case "zh-HK"
UICode = 3076
Case "zh-TW"
UICode = 1028
Case "cs-CZ"
UICode = 1029
Case "da-DK"
UICode = 1030
Case "fi-FI"
UICode = 1035
Case "el-GR"
UICode = 1032
Case "he-IL"
UICode = 1037
Case "hu-HU"
UICode = 1038
Case "ko-KR"
UICode = 1042
Case "nb-NO"
UICode = 1044
Case "pl-PL"
UICode = 1045
Case "pt-BR"
UICode = 1046
Case "pt-PT"
UICode = 2070
Case "ru-RU"
UICode = 1049
Case "sv-SE"
UICode = 1053
Case "tr-TR"
UICode = 1055
Case "bg-BG"
UICode = 1026
Case "hr-HR"
UICode = 1050
Case "et-EE"
UICode = 1061
Case "lv-LV"
UICode = 1062
Case "lt-LT"
UICode = 1063
Case "ro-RO"
UICode = 1048
Case "sr-Latn-CS"
UICode = 2074
Case "sk-SK"
UICode = 1051
Case "si-SI"
UICode = 1060
Case "th-TH"
UICode = 1054
Case "uk-UA"
UICode = 1058
Case Else
UICode = 1033
End Select

File_out.writeline("UICode set to: " & UICode)

If UICode > 999 and UICode < 10000 Then

File_out.writeline("zAZCFG-OCSLanguage: Writing language code to OCS key: " & UICode)
oShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommunicator MUIDefault Language", UICode, "REG_DWORD"
iRetVal = Success

Else

File_out.writeline("zAZCFG-OCSLanguage: Language Key not valid, defaulting to: en-US")
oShell.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommunicator MUIDefault Language", 1033, "REG_DWORD"
iRetVal = Success

End If

File_out.Close
Set FsoObj1 = Nothing

OCSLoc = iRetVal

End Function

Posted in Collaboration, vista | Tagged: , , , , , , , , , , | Leave a Comment »

OCS Localisation

Posted by Steven Westwell on February 21, 2008

As mentioned by John Lamb in his blog over at Modality Systems, we have been looking into automating the localisation of Office Communicator client.

After a bit of thought it seems most obvious to match the language of Office Communicator to the operating system language rather than Office, however before this happened I put together the following code to match the office communicator client to office 2007:


 OfficeCode=oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\LanguageResources\UILanguage")
  If Err.Number <> 0 Then
   ologging.CreateEntry "zAZCFG-OCSLanguage: Office Language Key not found, defaulting to: en-US", LogTypeInfo 
   oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Communicator MUI\Default Language", 1033, "REG_DWORD"
   iRetVal = Success
   
  Else
   If OfficeCode = 1033 Or OfficeCode = 2052 Or OfficeCode =  1043 _
    Or OfficeCode = 1036 Or OfficeCode = 1031 Or OfficeCode = 1041 _
    Or OfficeCode = 1042 Or OfficeCode = 1046 Or OfficeCode = 3082 _
    Or OfficeCode = 1028 Or OfficeCode = 1030 Or OfficeCode = 1035 _
    Or OfficeCode = 1040 Or OfficeCode = 1053    

    ologging.CreateEntry "zAZCFG-OCSLanguage: Writing language code to OCS key: " & OfficeCode, LogTypeInfo 
    oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Communicator MUI\Default Language", OfficeCode, "REG_DWORD"
    iRetVal = Success
   
   Else
   
    ologging.CreateEntry "zAZCFG-OCSLanguage: Office Language Key not supported in OCS MUI, defaulting to: en-US", LogTypeInfo 
    oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Communicator MUI\Default Language", 1033, "REG_DWORD"
    iRetVal = Success
   
   End If 
   
  End If 

oshell is a windows shell object and ologging is a ZTIUtility file writing parameter.

In the near future I will update with a script to set office communicator to match Vista :)

 Steven

Posted in Collaboration | Tagged: , , , , , , , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.