Archive: suggestion of localization


suggestion of localization
I found most of the strings that shown in detail view is in exehead\exec.c
could you use a xx.h file to define those words that people only need to modify the xx.h to localize makensis.
for example,
xx.h
#define WAITMSG "Wait..."
.....
exec.c
....
case EW_SLEEP:
{
int x=process_string_fromtab_toint(parms[0]);
if (x < 1) x=1;
//update_status_text("Wait...",""); //OLD
update_status_text(WAITMSG,""); //NEW
log_printf2("Sleep(%d)",x);
Sleep(x);
}
.....


hotice, I agree with you - it would be very nice to have an option to localize NSIS :).
But I think the better way is to build new commands like SetDetailsCompress, SetDetailsExecute, SetDetailsSleep, ... to give the user who is not familiar with compiling his own localized NSIS-version also the chance to build an localized installer.
With this method you could include a german.nsh, a romania.nsh or a french.nsh to have a fully localized installer :D

Regards,
~ Florian


To F. Heidenreich
I thinak to add new commands will increase the exehead size and need to modify source code much.
we could add a series of #ifdef/#endif statement in exehead/config.h
such as
#ifdef GER_LANG
#include "german.h"
#endif
then add a line
#define GER_LANG at the top of exehead/config.h
It's more flexible.


Good idea, I'll do this for 1.9a3 or whatever comes next. And I'll start making it more possible to have multiple languages per installer... i.e.

Language English
... define all of the language strings
ComponentText ...
LicenseText
LicenseData
ButtonText...
LanguageEnd


Language Espanol
... define spanish translations
ComponentText ...
LanguageEnd




etc. Then have a dialog that comes up at the beginning that prompts the user for which one they want to use. And you could customize your own messages by having a $LANGUAGE variable, that is the name of the current language, that way you could do things like:


StrCpy $0 "Do you want to pee?"
StrCmp $LANGUAGE english notspanish
StrCpy $0 "Quieres hacer pe?"
notspanish:

MessageBox MB_YESNO $0 IDNO no
Pee
no:

etc.
The nice thing is that if done right, you could disable multiple language functionality altogether from config.h, without a size penalty. Adding this would increase the exehead size by maybe 2kb at most.

As far as implementation, you could have a language specific string structure that would have all of the strings from the install/uninstall headers and common header that are relevant. I guess making the uninstaller smart would require the installer to save the language from the registry, and allow the uninstaller to query it (as well as allow upgrades of the installer to query it so they don't needlessly prompt the user). Anyhoo....

-Justin


This is what I have always dreamed of. :D

Thanks Justin for this very positive response!

~ Florian