Hi together!
is there a easy way to detect what language is used from operatingsystem MS is running on?
Any ideas would be great. I like to change the languages used in the script dialogs and messages automatically dependig on the OS-language.
Detecting OS language
Moderators: Dorian (MJT support), JRL
Detecting OS language
regards
migro
migro
Call the win32 API function: "GetSystemDefaultLangID"
It will return a language identifier:
You'll find all language identifiers in the Win32 programmers reference if you look for "Language Identifiers and Locales"
0413h is for example "Dutch (Standard)". To know what value Macro scheduler will return you, just do:
0413h = 1043d
65,536 - 1043 = 64493
so when the language is "Dutch (Standard)", macro scheduler will return the value '-64493'. Like this you can extend your script:
Do this for the rest of the languages you wish to support
It will return a language identifier:
Code: Select all
LibFunc>Kernel32,GetSystemDefaultLangID,nSysLanguage,
if>nSysLanguage=-64503
Message>%nSysLanguage% mean the language is American English
endif
0413h is for example "Dutch (Standard)". To know what value Macro scheduler will return you, just do:
0413h = 1043d
65,536 - 1043 = 64493
so when the language is "Dutch (Standard)", macro scheduler will return the value '-64493'. Like this you can extend your script:
Code: Select all
LibFunc>Kernel32,GetSystemDefaultLangID,nSysLanguage,
if>nSysLanguage=-64503
Message>%nSysLanguage% mean the language is American English
endif
if>nSysLanguage=-64493
Message>%nSysLanguage% mean the language is Dutch (Standard)
endif
Hi durexlw,
Thanks for posting this, very useful!
Thanks for posting this, very useful!
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
-
- Pro Scripter
- Posts: 149
- Joined: Tue Mar 23, 2004 9:11 pm
Re: Detecting OS language
Hi!
I have V14.2.03
And the result is not as expected:
LibFunc>Kernel32,GetSystemDefaultLangID,nSysLanguage,
Gives
0: NSYSLANGUAGE=16385053 <array>
How can I interpret the OS language from this?
I have V14.2.03
And the result is not as expected:
LibFunc>Kernel32,GetSystemDefaultLangID,nSysLanguage,
Gives
0: NSYSLANGUAGE=16385053 <array>
How can I interpret the OS language from this?
-
- Pro Scripter
- Posts: 149
- Joined: Tue Mar 23, 2004 9:11 pm
Re: Detecting OS language
Here is my findings:
Use this to get the OS language
RegistryReadKey>HKEY_LOCAL_MACHINE,\system\controlset001\control\nls\language,Installlanguage,TheLanguage
Use this to get the OS language
RegistryReadKey>HKEY_LOCAL_MACHINE,\system\controlset001\control\nls\language,Installlanguage,TheLanguage