#include "StdAfx.h"
#include "MergeApp.h"
#include "Merge.h"
-#include "version.h"
+#include "VersionInfo.h"
#include "paths.h"
-#include "Environment.h"
#include "Constants.h"
#include "unicoder.h"
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
+ nullptr,
nerr,
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
- NULL
+ nullptr
))
{
str = (LPCTSTR)lpMsgBuf;
+ // Free the buffer.
+ LocalFree( lpMsgBuf );
}
- // Free the buffer.
- LocalFree( lpMsgBuf );
return str;
}
return translated_str;
}
+String tr(const char *msgctxt, const std::string &str)
+{
+ String translated_str;
+ if (msgctxt)
+ theApp.TranslateString("\x01\"" + std::string(msgctxt) + "\"" + str, translated_str);
+ else
+ theApp.TranslateString(str, translated_str);
+ return translated_str;
+}
+
void AppErrorMessageBox(const String& msg)
{
AppMsgBox::error(msg);
AboutInfo::AboutInfo()
{
CVersionInfo verinfo;
- version = string_format_string1(_("Version %1"), verinfo.GetProductVersion());
+ version = strutils::format_string1(_("Version %1"), verinfo.GetProductVersion());
+ private_build = verinfo.GetPrivateBuild();
+ if (!private_build.empty())
+ {
+ version += _T(" + ") + private_build;
+ }
-#ifdef _UNICODE
- version += _T(" ");
- version += _("Unicode");
-#endif
+ if (version.find(_T(" - ")) != String::npos)
+ {
+ strutils::replace(version, _T(" - "), _T("\n"));
+ version += _T(" ");
+ }
+ else
+ {
+ version += _T("\n");
+ }
#if defined _M_IX86
- version += _T(" x86");
+ version += _T(" ");
+ version += _T("x86");
#elif defined _M_IA64
version += _T(" IA64");
#elif defined _M_X64
version += _T(" ");
version += _("X64");
+#elif defined _M_ARM64
+ version += _T(" ARM64");
#endif
- copyright = verinfo.GetLegalCopyright();
+#if defined _DEBUG
+ version += _T(" (");
+ version += _T("Debug");
+ version += _T(")");
+#endif
- private_build = verinfo.GetPrivateBuild();
- if (!private_build.empty())
- {
- private_build = string_format_string1(_("Private Build: %1"), private_build);
- }
+ copyright = _("WinMerge comes with ABSOLUTELY NO WARRANTY. This is free software and you are welcome to redistribute it under certain circumstances; see the GNU General Public License in the Help menu for details.");
+ copyright += _T("\n");
+ copyright += verinfo.GetLegalCopyright();
+ copyright += _T(" - All rights reserved.");
website = WinMergeURL;
}