From 362687501dddf16518f9462252e2b2f20ab07d54 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 13 Sep 2002 09:59:09 +0000 Subject: [PATCH] Now defines ${LANG_LangName} as the id of the language when loading a NLF. For example: ${LANG_ENGLISH}=1033 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@993 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/script.cpp b/Source/script.cpp index 2f5c51ef..304b0d75 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1403,6 +1403,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char string_tables.push_back(table); } last_used_lang=newNLF->GetLang(); + // define LANG_LangName as "####" (lang id) + // for example ${LANG_ENGLISH} = 1033 + char lang_id[16]; + char lang_name[128]; + char *nlf = line.gettoken_str(1); + char *tmp = strrchr(nlf, '.'); + if (tmp) *tmp = 0; + tmp = strrchr(nlf, '\\'); + wsprintf(lang_name, "LANG_%s", tmp?tmp+1:nlf); + wsprintf(lang_id, "%u", newNLF->GetLang()); + definedlist.add(lang_name,lang_id); } catch (exception &err) { ERROR_MSG("Error while loading language file: %s\n", err.what());