Old 24th January 2011, 22:09   #1
oryan_dunn
Junior Member
 
Join Date: Jul 2003
Posts: 19
How to i18n strings in nsh file?

I'm using this script here:
http://nsis.sourceforge.net/Java_Run...amic_Installer

Listed under future enhancements is
Quote:
The text strings used in this page should be configurable, and should be i18n aware
I wanted to i18n the strings, created LangStrings for all UI strings, placed the LangString lines at the end of the nsh, but they don't get read in. The only way I could get this to work is to put the LangString lines at the end of my main nsi file. What's the proper way to i18n a file that is meant to be included (and have that nsh file be all that's needed)?
oryan_dunn is offline   Reply With Quote
Old 24th January 2011, 23:23   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Do you get compiler warnings? When you use LangString you just have to use it after LoadLanguageFile (or in the case of MUI, !insertmacro MUI_LANGUAGE). Therefore to keep them in the header file you will have to include the header file after the languages are defined.

Stu
Afrow UK is offline   Reply With Quote
Old 25th January 2011, 14:04   #3
oryan_dunn
Junior Member
 
Join Date: Jul 2003
Posts: 19
Yes, I get warnings on the LangString and about a language table.

I tried moving the language declaration to before the include statement, but then I didn't have any strings at all (even the default ones included with nsis). I wasn't sure if there was a way to make the header file self-contained. Can I have the language declarations twice (just put one in the header file, and another in my main file)?
oryan_dunn is offline   Reply With Quote
Old 25th January 2011, 14:07   #4
oryan_dunn
Junior Member
 
Join Date: Jul 2003
Posts: 19
Sorry for the double post.
oryan_dunn is offline   Reply With Quote
Old 25th January 2011, 14:13   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I didn't say to move the language declarations. I said to move the !include. You have to have the language declarations after the page declarations.

Stu
Afrow UK is offline   Reply With Quote
Old 25th January 2011, 14:18   #6
oryan_dunn
Junior Member
 
Join Date: Jul 2003
Posts: 19
Thanks Stu,
The gotcha in this case is that the header file declares a function for a custom page, so it would seem it would need to come before the page declarations.

Ryan
oryan_dunn is offline   Reply With Quote
Old 25th January 2011, 17:05   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Functions can be anywhere in a script. They are linked at the end of the compile process.

Stu
Afrow UK is offline   Reply With Quote
Old 25th January 2011, 17:34   #8
oryan_dunn
Junior Member
 
Join Date: Jul 2003
Posts: 19
Is that also true of a macro? I forgot that this header has the macro/function pattern.
oryan_dunn is offline   Reply With Quote
Old 25th January 2011, 20:53   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
No, if it has macros then you are stuck.

Stu
Afrow UK 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