Skip to content
⌘ NSIS Forum Archive

Cant modify $LANGUAGE

5 posts

ramyaa#

Cant modify $LANGUAGE

Where can i change the $LANGUAGE variable?? The Docs say that it can be changed in the .onInit function , but im unable to do it. Can sombody throw more light on its usage? I want the $LANGUAGE to be same as that of the Locale... (same as HKEY_CURRENT_USER\Control Panel\International\Locale)
Thanks,
Ramya
Red Wine#
The taken value from that registry key isn't compatible with the value which should be stored in $LANGUAGE, so you'd need somehow to translate it e.g.
ReadRegStr $0 HKCU "Control Panel\International" "Locale"
StrCmp $0 "00000408" 0 next
StrCpy $LANGUAGE ${LANG_GREEK}
next:
Obviously this is too much, so it's better using the system plugin. Here is a snippet found in forum,
System::Call "kernel32::GetUserDefaultLangID()i .r0"
StrCpy $LANGUAGE $0
kichik#
0408 is actually almost the same as ${LANG_GREEK}. 0x408 is 1032 and so is ${LANG_GREEK}. So instead of a huge switch, simply copy 0x$0 into $LANGUAGE.

The System can be simplified as well. Use `i .a` instead of `i .r0` and the result will go directly into $LANGUAGE.