Added an option for unprocessed user multilingual strings (LangStringUP). Use it if you see weird squares before and special character in your LangString.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1298 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
24b350d801
commit
210e2d4e5e
5 changed files with 8 additions and 5 deletions
|
@ -139,7 +139,7 @@ class CEXEBuild {
|
|||
StringTable *GetTable(LANGID &lang);
|
||||
int SetString(char *string, int id, int process, WORD lang=0);
|
||||
int SetString(char *string, int id, int process, StringTable *table);
|
||||
int SetUserString(char *name, LANGID lang, char *string);
|
||||
int SetUserString(char *name, LANGID lang, char *string, int process=1);
|
||||
int WriteStringTables();
|
||||
void FillDefaultsIfNeeded(StringTable *table, NLF *nlf=0);
|
||||
#define IsNotSet(s) _IsNotSet(string_tables.size()?&(string_tables[0]->s):0)
|
||||
|
|
|
@ -184,7 +184,7 @@ int CEXEBuild::SetString(char *string, int id, int process, StringTable *table)
|
|||
return PS_OK;
|
||||
}
|
||||
|
||||
int CEXEBuild::SetUserString(char *name, LANGID lang, char *string) {
|
||||
int CEXEBuild::SetUserString(char *name, LANGID lang, char *string, int process/*=1*/) {
|
||||
StringTable *table = GetTable(lang);
|
||||
if (!table) return PS_ERROR;
|
||||
|
||||
|
@ -208,7 +208,7 @@ int CEXEBuild::SetUserString(char *name, LANGID lang, char *string) {
|
|||
}
|
||||
|
||||
user_strings->resize((idx+1)*sizeof(int));
|
||||
((int*)user_strings->get())[idx] = uninst ? add_string_uninst(string,1) : add_string_main(string,1);
|
||||
((int*)user_strings->get())[idx] = uninst ? add_string_uninst(string,process) : add_string_main(string,process);
|
||||
|
||||
for (int j = 0; j < string_tables.size(); j++) {
|
||||
if (j == idx) continue;
|
||||
|
|
|
@ -533,8 +533,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
|||
// header flags
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
case TOK_LANGSTRING:
|
||||
SCRIPT_MSG("LangString: \"%s\" %s \"%s\"\n", line.gettoken_str(1), line.gettoken_str(2), line.gettoken_str(3));
|
||||
if (SetUserString(line.gettoken_str(1), line.gettoken_int(2), line.gettoken_str(3)) != PS_OK)
|
||||
case TOK_LANGSTRINGUP:
|
||||
SCRIPT_MSG("LangString: \"%s\" %s \"%s\"%s\n", line.gettoken_str(1), line.gettoken_str(2), line.gettoken_str(3), which_token==TOK_LANGSTRINGUP?" (unprocessed)":"");
|
||||
if (SetUserString(line.gettoken_str(1), line.gettoken_int(2), line.gettoken_str(3), which_token==TOK_LANGSTRING) != PS_OK)
|
||||
{
|
||||
ERROR_MSG("Error: LangString: can't add user string!\n");
|
||||
return PS_ERROR;
|
||||
|
|
|
@ -93,6 +93,7 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_ISWINDOW,"IsWindow",2,1,"hwnd jump_if_window [jump_if_not_window]"},
|
||||
{TOK_GOTO,"Goto",1,0,"label"},
|
||||
{TOK_LANGSTRING,"LangString",3,0,"[un.]name lang_id string"},
|
||||
{TOK_LANGSTRINGUP,"LangStringUP",3,0,"[un.]name lang_id string"},
|
||||
{TOK_LICENSEDATA,"LicenseData",1,1,"[/LANG=lang_id] local_file_that_has_license_text.txt"},
|
||||
{TOK_LICENSETEXT,"LicenseText",1,2,"[/LANG=lang_id] license_page_description [license_button_text]"},
|
||||
{TOK_LICENSEBKCOLOR,"LicenseBkColor",1,0,"background_color"},
|
||||
|
|
|
@ -54,6 +54,7 @@ enum
|
|||
TOK_COMPLETEDTEXT,
|
||||
|
||||
TOK_LANGSTRING,
|
||||
TOK_LANGSTRINGUP,
|
||||
|
||||
// system "preprocessor"ish tokens
|
||||
TOK_P_IFDEF,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue