Old 28th August 2004, 10:02   #1
VCR
Junior Member
 
Join Date: Aug 2004
Location: Japan
Posts: 37
Create language file with user defined messages

Hi all,

As I want to create a installer with 15 languages support, and there are almost 100 user defined messages for each language. How do I create variables for these string and call themm appropriately in different languages.

I thought of creating my own .nlf file for each languages containing all the messages, but I don't know the predefined variable name to be used.

Thanks in advance.

Regards
VCR
VCR is offline   Reply With Quote
Old 28th August 2004, 10:58   #2
razor_x
Member
 
Join Date: Feb 2004
Posts: 58
if you are talking about "custom" strings ...then this is a HUGE undertaking as each string has to be defined seperately in each language,If you are talking about the MUI strings then there are .nsh files you can include.you will have to use langstring for each custom string like this...
PHP Code:
LangString message ${LANG_ENGLISH"English message" 
razor_x is offline   Reply With Quote
Old 28th August 2004, 11:07   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
See:

http://nsis.sourceforge.net/archive/...php?pageid=120

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
Old 28th August 2004, 12:16   #4
VCR
Junior Member
 
Join Date: Aug 2004
Location: Japan
Posts: 37
Thanks for your help.
I need the "custom" strings support as each string has to be defined seperately in each language.
Can anyone tell me the complexity and tell me how can we do this?
Thanks again.
VCR is offline   Reply With Quote
Old 28th August 2004, 14:11   #5
razor_x
Member
 
Join Date: Feb 2004
Posts: 58
look at langstring in the docs..and I hope you dont have alot of them you will have to convert all of them from english to all 15 languages.Each string
razor_x is offline   Reply With Quote
Old 28th August 2004, 14:55   #6
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
In my program I use the a language system that the user can customize the language files as they wish, contributing to the project (like we do for NSIS). To work, this language system needs:

1) Language INI files. Format:

code:
[Program Page or Section]
ValueName=Value

2) Variable to store what language file the user chose:

code:
Var LangFile
3) Multilanguage support macros:

code:
# Multilanguage Support Macros

!define PageName '!insertmacro PageName'
!define ReadString '!insertmacro ReadString'

!macro PageName PAGE
!ifdef PageName
!undef PageName
!endif
!define PageName `${PAGE}`
!macroend

!macro ReadString OUTVAR NAME
ReadINIStr ${OUTVAR} `$LangFile` `${PAGENAME}` `${NAME}`
!macroend

4) To create a language selector inside your program that changes the variable $LangFile when the user selects another language file.

5) To read a string from the language selected file:

- First, you need to define the page name or section of a part of your program using the macro:

code:
${PageName} "Program Page or Section"
- Then to read from a value name of this page or section:

code:
${ReadString} $var "ValueName"

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 30th August 2004, 07:28   #7
VCR
Junior Member
 
Join Date: Aug 2004
Location: Japan
Posts: 37
Thanks for ur support.
Can u please give me one example source code.

Lets suppose my custom string in english is

RMV_STRING Remove Complete
RMV_STRING1 Remove in progress
....
.....
..... almost 100 messages

and the corresponding string in French is as

RMV_STRING Désinstallation terminée
........

like wise the string in 15 other languages are also available.

Now as these are my custom messages, I want these to be displayed as a message box in the language, the user has choosen the language of installation.

So can any one give me full guide for this.

Thanks in advance
VCR
VCR is offline   Reply With Quote
Old 30th August 2004, 13:47   #8
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Generally when you get a string from an INI file, NSIS doesn't convert it to support $\t, $\r and $\n (you have the text but NSIS doesn't see the characters as escape characters). I'll create for you a code for this when I come back here. Or maybe someone wants to do it for me first...

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 30th August 2004, 14:01   #9
zimsms
Senior Member
 
zimsms's Avatar
 
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
See my example (link below).
zimsms is offline   Reply With Quote
Old 30th August 2004, 16:08   #10
VCR
Junior Member
 
Join Date: Aug 2004
Location: Japan
Posts: 37
Thanks for providing the sources. I wil go through it.

Thanks and Regards
VCR
VCR 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