Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 23rd January 2013, 22:57   #1
sledgehammer_999
Junior Member
 
Join Date: Jan 2013
Posts: 27
How to use a default translation when a string isn't yet translated?

I am trying to make my installer multi language. I use the langstring functionality. The problem is that although I have enabled all the languages for the installer itself(via the langdll) not all my strings are translated to all available languages. So when a user selects a language that I don't have translations for, the installer is translated but my own strings are appearing empty in that language. Is there any way to make NSIS use a default language (eg english) until I get these strings translated to other languages?

eg

LangString message $(LANG_ENGLISH) "blah"
LangString message $(LANG_ITALIAN) "blah"

but the user chooses as language Greek. Is there any way to make NSIS display the english version of message since it cannot find the Greek equivalent?

Thanks.
sledgehammer_999 is offline   Reply With Quote
Old 24th January 2013, 06:35   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
I suppose this is already implemented in NSIS.
The first language used is the default one.

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 24th January 2013, 13:44   #3
sledgehammer_999
Junior Member
 
Join Date: Jan 2013
Posts: 27
I am not sure on how to do it. Here is sample NSIS script that displays the problem.

PHP Code:
XPStyle on

!include "MUI.nsh"

OutFile "setup.exe"

!define MUI_ABORTWARNING
!define MUI_HEADERIMAGE
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_LICENSEPAGE_CHECKBOX
!define MUI_LANGDLL_ALLLANGUAGES

;Installer Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

;--------------------------------
;
Uninstaller Pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Esperanto"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Welsh"

LangString message ${LANG_ENGLISH"english"
LangString message ${LANG_ITALIAN"italian"


Section $(message)
SectionEnd

Function .onInit       

    
!insertmacro MUI_LANGDLL_DISPLAY        
    
FunctionEnd 
If you choose either english or italian in the langdll the section name appears in the components page. If you choose any other eg greek the section name doesn't appear (not even in english).
sledgehammer_999 is offline   Reply With Quote
Old 26th January 2013, 12:16   #4
sledgehammer_999
Junior Member
 
Join Date: Jan 2013
Posts: 27
Anyone?
sledgehammer_999 is offline   Reply With Quote
Old 26th January 2013, 15:22   #5
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
The notes for LangString says that you should always set language strings for every language in your script.

Just fill in all the languages and use the english string for the languages you don't have a translation.

PaR

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} 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