Old 14th April 2007, 22:56   #1
fishsauce
Junior Member
 
Join Date: Jul 2005
Posts: 40
System locale tip

I'd just like to make a remark since it took me awhile to figure this out.

To get the setting for language for non-Unicode programs (the system locale), you can use:
code:
System::Call "kernel32::GetSystemDefaultLCID()i .R0"
Pop $R0


The 4-digit decimal locale code will be returned in $R0 (i.e. 1033 for en-US).

At first I tried the 'Detect User Locale INFO' example in the wiki
http://nsis.sourceforge.net/Detect_U...C_LangID...%29
but it didn't detect the system locale correctly.

Hope this helps someone.
fishsauce is offline   Reply With Quote
Old 15th April 2007, 16:18   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
You may want to add the remark on the referred wiki page so would be accessible by everyone.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 9th January 2008, 00:28   #3
Makedon
Junior Member
 
Join Date: Jan 2008
Posts: 6
To be more specific ,for automatic locale language detection
PHP Code:
Function .onInit

   System
::Call "kernel32::GetSystemDefaultLCID()i .R0"
   
StrCpy $LANGUAGE $R0
   Pop $R0  
   
FunctionEnd 
Makedon is offline   Reply With Quote
Old 9th January 2008, 09:40   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Or even:
System::Call "kernel32::GetSystemDefaultLCID()i .a"
a = $LANGUAGE.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump