BitByteBit Posted July 13, 2010 Posted July 13, 2010 (edited) I work as an IT technician, I recently moved country. This poses a minor problem (sometimes) in the sense that the operating systems I work on are quite often in Swedish. I just started work on a script that will change the current display language to English, then back again to Swedish. I would looked into ways to do this silently, it seems to be that you need to create a ini or xml (depending on the OS), then run intl.cpl with a command line parameter pointing to the ini or xml. (Source: http://www.microsoft.com/middleeast/arabicdev/DevTools/more/RegionalSettings.aspx#4_1) After fighting with it for 2 days, with no success, I gave up and automated opening regional language settings. So my questions are: 1. Why does @OSLang return English when the PC is set to Swedish? 2. Has any one done this, or anything similar before? I've repeatedly looked and turned up little-to-nothing. 3. Is there a way to change the display language through dll calls? Of course, here is what I have got so far. Let it be known I tried on my own to do this, using different methods. Only when I felt I had exhausted my resources that I came to ask for help. Thanks for your time. expandcollapse popup;Returns english when swedish is set as the display language? Select Case @MUILang == 0000 MsgBox(0, "No dice...", "MUI not installed") ;Detect active language, then silently install appropriate language pack? ;Note: I must find standalone language packages. Exit Case StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) _ChangeLanguage("Eng", @OSVersion) Case StringInStr("041d 081d", @OSLang) _ChangeLanguage("Swe", @OSVersion) Case Else MsgBox(0, "No dice...", "Unrecognised local language") EndSelect Func _ChangeLanguage($Language, $OS) Select Case $Language == "Eng" And $OS == "WIN_7" Global $Title = "Region and Language" ToolTip("Current language: English", 5, 21) Run("control intl.cpl") If @error Then MsgBox(0, "Uhhhh..", "Houston, we have a problem") Exit EndIf WinWait($Title, "", 3) If WinExists("Nationella inställningar och språkinställningar") Then ContinueCase ;Workaround!!! ControlClick($Title, "", "SysTabControl321", "Primary", 1, 155, 10) WinWait($Title, "To change your keyboard or inp", 10) ToolTip("") ControlCommand($Title, "", "ComboBox1", "SelectString", 'svenska') If @error Then ControlCommand($Title, "", "ComboBox1", "SelectString", 'Svenska') ;Click apply, then click ok on log out now, possible to log back in? Case $Language == "Swe" And $OS == "WIN_7" Global $Title = "Nationella inställningar och språkinställningar" ToolTip("Current language: Svensk", 5, 21) Run("control intl.cpl") If @error Then MsgBox(0, "Uhhhh..", "Houston, we have a problem") Exit EndIf WinWait($Title, "", 3) ControlClick($Title, "", "SysTabControl321", "Primary", 1, 155, 10) WinWait($Title, "Tangentbord och språk", 10) ToolTip("") ControlCommand($Title, "", "ComboBox1", "SelectString", 'English') If @error Then ControlCommand($Title, "", "ComboBox1", "SelectString", 'english') ;Click apply, then click ok on log out now, possible to log back in? Case Else MsgBox(0,"Need more cases!",$Language & " - "& $OS) EndSelect EndFunc ;==>_ChangeLanguage ;http://www.microsoft.com/middleeast/arabicdev/DevTools/more/RegionalSettings.aspx#4_1 = Silently set in XP ;http://technet.microsoft.com/en-us/library/cc721887(WS.10).aspx = Vista, probably Windows 7 also. ;Registy: HKEY_Local_Machine\System\CurrentControlSet\Control\MUI\UILanguages\ #cs XP Ini. ;Rundll32 shell32,Control_RunDLL intl.cpl,,/f:"c:\unattend.txt" ;[RegionalSettings] ;XP Ini ;LanguageGroup=13 ;SystemLocale=0401 #ce #cs Vista XML <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> <!-- User List --> <gs:UserList> <gs:User UserID="Current" CopySettingsToSystemAcct="true" /> </gs:UserList> <!-- MUI--> <gs:MUILanguagePreferences> <gs:MUILanguage Value="sv-SE" /> <gs:MUIFallback Value="en-US" /> </gs:MUILanguagePreferences> </gs:GlobalizationServices> #ce Edited July 13, 2010 by BitByteBit
Yashied Posted July 13, 2010 Posted July 13, 2010 Maybe this will be useful for you. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
BitByteBit Posted July 14, 2010 Author Posted July 14, 2010 Thanks for the quick response Yashied. Nice script, but this isn't quite what I'm looking to do; unless I'm missing something and this can be done through your WinApiEx UDF? Rather than changing the keyboard layout, I'm looking for a way to silently change the OS language if that makes any sense. Should I just stick with automating the process of opening Regional and Language Settings?
Developers Jos Posted August 9, 2020 Developers Posted August 9, 2020 25 minutes ago, BhanuSrikanth said: Any success on changing OS language? Please simply stick to your own thread as this cross posting is annoying. thanks SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts