Old 6th November 2006, 14:54   #1
RichardH
Junior Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 1
Strange new behaviour in LangStrings + InstallDir + Name

When updating to a new version of NSIS I found out that the default language is now selected by NSIS.

Since I have different application titles(and data) depending on the language selected the following stopped working(MUI):

Name $(appName)
InstallDir "$PROGRAMFILES\$(appName)"
...
LangString appName ${LANG_ENGLISH} "Reading World Demo"
LangString appName ${LANG_ITALIAN} "Lettere e Parole Demo"

Before the Name and InstallDir $(appName) was the same but now InstallDir selects the title and data depending on the OS lang. Name works as before though.

What is the recommended way of restoring the "old way"?

Suddenly I feel like a little bit of freedom has been stolen from the great NSIS.
RichardH is offline   Reply With Quote
Old 6th November 2006, 18:11   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
From the release notes of version 2.13:
Quote:
Language detection has changed. The default language is now set to the user's user-interface language instead of the locale language, as suggested by MSDN. To restore the old behavior, use System::Call "kernel32::GetUserDefaultLangID()i.a" in .onInit.
That's the only thing that has changed in a long time concerning languages.

The different language of $INSTDIR and the title comes from an unrelated issue. $INSTDIR is initialized from InstallDir before .onInit and before the user has a chance to change the language. Therefore, if you're using LangStrings in it, you should recalculate it after the language changes. You can do it with a switch in .onInit or by using the LangString in .onGUIInit.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik 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