only_johhny
10th December 2007 21:32 UTC
Wanted empty language strings
Because of the different grammar it make sometimes sense to have different Word orders. This can be done by:
DetailPrint "$\n*** $(Adding1) $(${SecName}_NAME)$(Adding2)..."
LangString Adding1          ${LANG_ENGLISH} ""
LangString Adding2          ${LANG_ENGLISH} "englishtext"
LangString Adding1          ${LANG_GERMAN}  "germantext"
LangString Adding2          ${LANG_GERMAN}  ""
But there are always the warnings
      
        LangString "Adding1" is not set in language table of language English
        LangString "Adding2" is not set in language table of language German
      
This warning is indeed usefull if you 'forget' to set a string but for these two strings above I want do disable it. Is it possible to do something like
      
LangString Adding1          ${LANG_ENGLISH} nothing
? Thank you in advance for your help.
    
 
    
      Afrow UK
      10th December 2007 22:00 UTC
      Are you sure that is right and it's not just because your LangString's are before you include the languages?
      
      Stu
     
    
      bholliger
      12th December 2007 18:59 UTC
      Re: Wanted empty language strings
      Hi!
      
      Have a look at the following sample. I think it demonstrates, what you want:
      
      
!include "MUI.nsh"
!include "WordFunc.nsh"
!insertmacro WordReplace
;The file to write
OutFile "test.exe"
ShowInstDetails show
;Verwendete Pages
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
Section
  Var /GLOBAL "tmp"
  ; Handle white spaces
  ${WordReplace} "$(Adding1)Johny$(Adding2)" " " "" "{}*" $tmp
  Detailprint "$tmp"
SectionEnd
Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
LangString Adding1 ${LANG_GERMAN} "Prost "
LangString Adding2 ${LANG_GERMAN} " "
LangString Adding1 ${LANG_ENGLISH} " "
LangString Adding2 ${LANG_ENGLISH} ", cheers!"
; eof
      
      If you set langstrings to "", NSIS thinks they are undefined. Just enter white spaces and everything's ok.
      
      Cheers,
      Bruno.
    
 
    
      only_johhny
      14th December 2007 22:02 UTC
      This is a workaround for my problem but I woukd prefer a way to say NSIS this string HAS TO be empty, maybe via another parameter then "", for example NULL.
      
      Is there a function like that or can it be easily added?
     
    
      only_johhny
      9th January 2008 19:33 UTC
      Should I post a Feature Request (and if yes: where)?
     
    
      Afrow UK
      9th January 2008 21:16 UTC
      http://nsis.sourceforge.net/Bug_Reports
      
      Stu