Display English and German in LangDLL if the codepage is 1250 (Bug #1185)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6873 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
273ea199ce
commit
a7eff3874c
2 changed files with 26 additions and 6 deletions
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
// JF> updated usage
|
// JF> updated usage
|
||||||
// call like this:
|
// call like this:
|
||||||
// LangDLL:LangDialog "Window Title" "Window subtext" <number of languages>[F] language_text language_id ... [font_size font_face]
|
// LangDLL:LangDialog "Window Title" "Window subtext" <number of languages|"A">[C][F] language_text language_id [codepage] ... [font_size font_face]
|
||||||
// ex:
|
// ex:
|
||||||
// LangDLL:LangDialog "Language Selection" "Choose a language" 2 French 1036 English 1033
|
// LangDLL:LangDialog "Language Selection" "Choose a language" "2" French 1036 English 1033
|
||||||
// or (the F after the 2 means we're supplying font information)
|
// or (the F after the 2 means we're supplying font information)
|
||||||
// LangDLL:LangDialog "Language Selection" "Choose a language" 2F French 1036 English 1033 12 Garamond
|
// LangDLL:LangDialog "Language Selection" "Choose a language" "2F" French 1036 English 1033 12 Garamond
|
||||||
//
|
//
|
||||||
// Unicode support added by Jim Park -- 07/27/2007
|
// Unicode support added by Jim Park -- 07/27/2007
|
||||||
|
|
||||||
|
@ -33,6 +33,26 @@ struct lang {
|
||||||
UINT cp;
|
UINT cp;
|
||||||
} *langs;
|
} *langs;
|
||||||
|
|
||||||
|
#ifndef UNICODE
|
||||||
|
static UINT AllowLang(struct lang*pL)
|
||||||
|
{
|
||||||
|
UINT acp = GetACP(), lcp = pL->cp, allow = lcp == acp;
|
||||||
|
/*
|
||||||
|
** Workaround for bug #1185:
|
||||||
|
** English and German can be displayed in cp1250
|
||||||
|
*/
|
||||||
|
if (acp == 1250 && lcp == 1252)
|
||||||
|
{
|
||||||
|
const UINT lid = myatou(pL->id);
|
||||||
|
if (lid == 1033 // English
|
||||||
|
|| lid == 1031 // German
|
||||||
|
)
|
||||||
|
++allow;
|
||||||
|
}
|
||||||
|
return allow;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
INT_PTR i;
|
INT_PTR i;
|
||||||
|
@ -194,10 +214,10 @@ void NSIS_DECLSPEC_DLLEXPORT LangDialog(HWND hwndParent, int string_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Unicode, show everything.
|
// If Unicode, show everything.
|
||||||
#ifdef _UNICODE
|
#ifdef UNICODE
|
||||||
visible_langs_num++;
|
visible_langs_num++;
|
||||||
#else
|
#else
|
||||||
if (!docp || langs[visible_langs_num].cp == GetACP() || langs[visible_langs_num].cp == 0)
|
if (!docp || AllowLang(&langs[visible_langs_num]) || langs[visible_langs_num].cp == 0)
|
||||||
{
|
{
|
||||||
visible_langs_num++;
|
visible_langs_num++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ This constant is not available on Windows 95 unless Internet Explorer 4 with Act
|
||||||
|
|
||||||
The local (non-roaming) application data directory.
|
The local (non-roaming) application data directory.
|
||||||
|
|
||||||
This constant is available on Windows 2000 and above.
|
This constant is available on Windows ME, 2000 and above.
|
||||||
|
|
||||||
\e{$PRINTHOOD}
|
\e{$PRINTHOOD}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue