Skip to content
⌘ NSIS Forum Archive

output files altered by language selection

39 posts

cri_ned#
Well I have the begining of the script, with some dfines, including some variables of my own, for when specific situations occur, like:

!define AFFILIATE_STRING "something..."

!define ENGLISH_LANGUAGE
!define FRENCH_LANGUAGE
!define GERMAN_LANGUAGE
!define SPANISH_LANGUAGE
!define DUTCH_LANGUAGE
!define DANISH_LANGUAGE
!define SWEDISH_LANGUAGE
(I am not always using all the languages)

!define SILENT_BUILD


after this I have:

!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "something..."
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

After that are the name and all, and the get params as seen here, as long with the on init part of getparams:

in oninit I have this:

!ifdef SILENT_BUILD
Call GetParameters

Pop $R0
${Switch} $R0

${Default}
StrCpy $Language ${LANG_ENGLISH}
${Break}

${Case} "/fr"
StrCpy $Language ${LANG_FRENCH}
${Break}

${Case} "/de"
StrCpy $Language ${LANG_GERMAN}
${Break}

${Case} "/es"
StrCpy $Language ${LANG_SPANISH}
${Break}

${Case} "/nl"
StrCpy $Language ${LANG_DUTCH}
${Break}

${Case} "/dk"
StrCpy $Language ${LANG_DANISH}
${Break}

${Case} "/se"
StrCpy $Language ${LANG_SWEDISH}
${Break}

${EndSwitch}

!endif

The install part works ok, I don't have any errors or anything. The problem is with the uninstall.

in un.oninit I have this as the first line:

!insertmacro MUI_UNGETLANGUAGE
.

If left like this, it will ask to pick the language. If commented, it will use the default windows language, not the one picked for the install.

That is where I have the problem...

Thanks a lot for the help.
Cristi
cri_ned#
Hi,

Me again 🙂

any ideea, or is it something like a bug?

I still haven't found out why it doesn't write the registry key.

thanks!
cri_ned#
Hi,

I'm sorry I didn't put the script. I have to make a shorter version of it. Just to let you know, I found a fix for the problem by working around it, and reading a different registry key that my program allready put there, in order to know the language. I used this code:

ReadRegStr $0 HKCU Software\... "Language"

${If} $0 S== "en"
StrCpy $LANGUAGE ${LANG_ENGLISH}
${Else}

${If} $0 S== "fr"
StrCpy $LANGUAGE ${LANG_FRENCH}
${Else}

${If} $0 S== "se"
StrCpy $LANGUAGE ${LANG_SWEDISH}
${Else}

${If} $0 S== "de"
StrCpy $Language ${LANG_GERMAN}
${Else}

${If} $0 S== "es"
StrCpy $Language ${LANG_SPANISH}
${Else}

${If} $0 S== "nl"
StrCpy $Language ${LANG_DUTCH}
${Else}

${If} $0 S== "dk"
StrCpy $Language ${LANG_DANISH}
${Else}

${If} $0 S== "it"
StrCpy $Language ${LANG_ITALIAN}
${Else}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}

and the uninstaller works in what language I need. I'll put the shorter script later this week, in order to let you guys check if it is a bug or something because of me. 🙂

Cristi
glory_man#
Simple comment.
Instead combination ${Else} ${If} you can use ${ElseIf} and close it with one ${EndIf}.
cri_ned#
Hi all,

I have a new problem. I use a page that is from an ini. It has some text, which I need to be able to display according to the language of the installer. Is there a way to use those pages in a similar manner to this:

LicenseLangString license ${LANG_ITALIAN} "D:\...\license.txt" ?

Thanks a lot for the help guys. I don't know where my installer would be without you. 🙂
Afrow UK#
You need to write the language string to the INI file on run-time with WriteINIStr:

WriteINIStr "$PLUGINSDIR\ioFile.ini" "Field #" "Text" "$(license)"

-Stu
onad#
Multilingual example in Moreinfo

Multilingual example in Moreinfo plugin. Multi language in an easy extensible way in one of the demos. Will solve a lot of multilanguage language problems.
The "CustomLanguageDemo" Fully shows the power of getting the OS GUI language. I the demo a good example of how custompage localization works and could be implemented.

See the Wikipage



Or take a look in:



Just try the "CustomLanguageDemo" demo included.