Archive: Create language file with user defined messages


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


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...

LangStringmessage${LANG_ENGLISH}"Englishmessage"


See:

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


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.


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 :)


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:

[Program Page or Section]
ValueName=Value
2) Variable to store what language file the user chose:

Var LangFile
3) Multilanguage support macros:

# 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:

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

${ReadString} $var "ValueName"

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


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...


See my example (link below).


Thanks for providing the sources. I wil go through it.

Thanks and Regards
VCR