VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Language.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Language.c')
-rw-r--r--src/Common/Language.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Common/Language.c b/src/Common/Language.c
index a6bc9891..11c791d8 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -315,113 +315,113 @@ static BOOL LoadLanguageData (int resourceid, BOOL bForceSetPreferredLanguage, B
if (!defaultLangParsed
|| strcmp (attr, langId) == 0)
{
Font font;
memset (&font, 0, sizeof (font));
XmlGetAttributeText (xml, "face", attr, sizeof (attr));
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
font.FaceName = AddPoolData ((void *) wattr, len * 2);
XmlGetAttributeText (xml, "size", attr, sizeof (attr));
sscanf (attr, "%d", &font.Size);
StringCbCopyA (attr, sizeof(attr), "font_");
XmlGetAttributeText (xml, "class", attr + 5, sizeof (attr) - 5);
AddDictionaryEntry (
AddPoolData ((void *) attr, strlen (attr) + 1), 0,
AddPoolData ((void *) &font, sizeof(font)));
}
xml++;
}
// Create string and control dictionaries
for (i = 0; xmlElements[i] != 0; i++)
{
xml = (char *) res;
while (xml = XmlFindElement (xml, xmlElements[i]))
{
- void *key;
+ void *pkey;
void *text;
XmlGetAttributeText (xml, "lang", attr, sizeof (attr));
if (!defaultLangParsed
|| strcmp (attr, langId) == 0)
{
if (XmlGetAttributeText (xml, "key", attr, sizeof (attr)))
{
- key = AddPoolData (attr, strlen (attr) + 1);
- if (key == NULL) return FALSE;
+ pkey = AddPoolData (attr, strlen (attr) + 1);
+ if (pkey == NULL) return FALSE;
XmlGetNodeText (xml, attr, sizeof (attr));
// Parse \ escape sequences
{
char *in = attr, *out = attr;
while (*in)
{
if (*in == '\\')
{
in++;
switch (*in++)
{
case '\\': *out++ = '\\'; break;
case 't': *out++ = '\t'; break;
case 'n': *out++ = 13; *out++ = 10; break;
default:
if (!bForceSilent)
- MessageBoxA (0, key, "VeraCrypt: Unknown '\\' escape sequence in string", MB_ICONERROR);
+ MessageBoxA (0, pkey, "VeraCrypt: Unknown '\\' escape sequence in string", MB_ICONERROR);
return FALSE;
}
}
else
*out++ = *in++;
}
*out = 0;
}
// UTF8 => wide char
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
if (len == 0)
{
if (!bForceSilent)
- MessageBoxA (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
+ MessageBoxA (0, pkey, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
return FALSE;
}
// Add to dictionary
text = AddPoolData ((void *) wattr, len * 2);
if (text == NULL) return FALSE;
- AddDictionaryEntry ((char *) key, 0, text);
+ AddDictionaryEntry ((char *)pkey, 0, text);
}
}
xml++;
}
}
if (langFound)
break;
if (!defaultLangParsed)
{
defaultLangParsed = TRUE;
if ((resourceid == 0) && (langId[0] == 0 || strcmp (langId, "en") == 0))
break;
}
}
LocalizationActive = langFound && strcmp (langId, "en") != 0;
LocalizationSerialNo++;
if (bForceSetPreferredLanguage)
StringCbCopyA (PreferredLangId, sizeof (PreferredLangId), langId);
// Create control ID dictionary
// Default controls
AddDictionaryEntry (NULL, 1, GetString ("IDOK"));
AddDictionaryEntry (NULL, 2, GetString ("IDCANCEL"));
AddDictionaryEntry (NULL, 8, GetString ("IDCLOSE"));