Skip to content
⌘ NSIS Forum Archive

Language detection

9 posts

Benni_P#

Language detection

Hello,
how can I let NSIS detect which language is given by the system?
And can I use this information to select/deselect some InstallOptions? (For example some translations for an application)
Afrow UK#
;1033 == English
StrCmp $LANGUAGE 1033 0 +2
WriteINIStr "IOfile.ini" "Field X" "State" "1" ;select check-box
-Stu
Benni_P#
Ok, I now know how to use it.
But it does nothing.
No Section is selected or deselected if I write "0" instead if "1"

This is my code:
Function .onInit
  StrCmp $LANGUAGE 1033 0 +2
  WriteINIStr "IOfile.ini" "Group En" "State" "1" ;select check-box
FunctionEnd
SubSection /e "En / Ger" SEC00
 Section /o "Group En" SEC01
 SectionEnd
 Section /o "Group Ger" SEC02
 SectionEnd
SubSectionEnd 
Joel#
A long time did a multilanguage installer... with some of your code & mine:

SetCompressor lzma
XPStyle on

Name "Lobo Lunar"
OutFile "Test.exe"
BrandingText "Lobo Lunar"
InstallDir "$EXEDIR"
ShowInstDetails show

Page components
Page instfiles

SubSection "Languages"

Section /o "English" english
; Put stuff
SectionEnd

Section /o "Other" other
; More stuff
SectionEnd

SubSectionEnd

Function .onInit
StrCmp $LANGUAGE 2058 ENG OTHER

ENG:
SectionSetFlags ${english} 1
Goto Exit

OTHER:
WriteINIStr "$EXEDIR\myini.ini" "LANG" "ID" "1"
SectionSetFlags ${other} 1

Exit:
FunctionEnd
Guest#
[QUOTE]Originally posted by Afrow UK
[B]
;1033 == English
StrCmp $LANGUAGE 1033 0 +2
WriteINIStr "IOfile.ini" "Field X" "State" "1" ;select check-box
This will check the language selected for the installation. This might not be the OS language. How can I detect the language of the operating system!?
Afrow UK#
As far as I know, $LANGUAGE will contain the OS language unless you change it via LangDLL

-Stu