+#if defined(__WIN32__)
+#define MessageBox _MessageBox
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef MessageBox
+#endif
+
#ifdef ECERE_STATIC
public import static "ecere"
#else
if(path)
{
int len;
- len = strlen(path);
+ len = (int)strlen(path);
copy = CopyString(path);
if(len)
{
void RemoveTrailingPathSeparator(char *path)
{
int len;
- len = strlen(path);
+ len = (int)strlen(path);
if(len>1 && path[len-1] == DIR_SEP)
path[--len] = '\0';
}
{ [
{ "English", ":countryCode/gb.png", "" },
{ "汉语", ":countryCode/cn.png", "zh_CN" },
- { "Español", ":countryCode/es.png", "es_ES" },
- { "Русский (43%)", ":countryCode/ru.png", "ru_RU" },
- { "Português (28%)", ":countryCode/pt.png", "pt_BR" },
- { "Nederlandse (13%)", ":countryCode/nl.png", "nl_NL" },
- { "Tiếng Việt (12%)", ":countryCode/vn.png", "vi_VI" },
- { "मराठी (10%)", ":countryCode/in.png", "mr_MR" },
- { "Hebrew (8%)", ":countryCode/il.png", "he_HE" },
- { "Magyar (8%)", ":countryCode/hu.png", "hu_HU" }
+ { "Español", ":countryCode/es.png", "es" },
+ { "Português (Brazil)", ":countryCode/br.png", "pt_BR" },
+ { "Русский (43%)", ":countryCode/ru.png", "ru" },
+ { "Nederlandse (13%)", ":countryCode/nl.png", "nl" },
+ { "Tiếng Việt (12%)", ":countryCode/vn.png", "vi" },
+ { "मराठी (10%)", ":countryCode/in.png", "mr" },
+ { "Hebrew (8%)", ":countryCode/il.png", "he" },
+ { "Magyar (8%)", ":countryCode/hu.png", "hu" }
] };
String GetLanguageString()
{
- String language = getenv("LANGUAGE");
+ String language = getenv("ECERE_LANGUAGE");
+ if(!language) language = getenv("LANGUAGE");
if(!language) language = getenv("LC_ALL");
if(!language) language = getenv("LC_MESSAGES");
if(!language) language = getenv("LANG");
{
bool restart = true;
String command = null;
- int arg0Len = strlen(app.argv[0]);
+ int arg0Len = (int)strlen(app.argv[0]);
int len = arg0Len;
int j;
char ch;
strcat(command, " ");
len++;
ReplaceSpaces(command + len, name);
- len = strlen(command);
+ len = (int)strlen(command);
}
}
}
{
settings.language = code;
settingsContainer.Save();
+
+#if defined(__WIN32__)
+ // Set LANGUAGE environment variable
+ {
+ HKEY key = null;
+ uint16 wLanguage[256];
+ HRESULT status;
+ wLanguage[0] = 0;
+
+ RegCreateKeyEx(HKEY_CURRENT_USER, "Environment", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
+ if(key)
+ {
+ UTF8toUTF16Buffer(code, wLanguage, sizeof(wLanguage) / sizeof(uint16));
+ RegSetValueExW(key, L"ECERE_LANGUAGE", 0, REG_EXPAND_SZ, (byte *)wLanguage, (uint)(wcslen(wLanguage)+1) * 2);
+ RegCloseKey(key);
+ }
+ }
+#endif
+
if(eClass_IsDerived(app._class, class(GuiApplication)))
{
GuiApplication guiApp = (GuiApplication)app;
strcat(command, " ");
len++;
ReplaceSpaces(command + len, app.argv[i]);
- len = strlen(command);
+ len = (int)strlen(command);
}
}
if(restart)
{
- SetEnvironment("LANGUAGE", code);
+ SetEnvironment("ECERE_LANGUAGE", code);
if(wait)
ExecuteWait(command);
else