OSDN Git Service

Fix issue #940: Replace slow (2)
[winmerge-jp/winmerge-jp.git] / Src / MergeApp.cpp
index c52260a..1f14b60 100644 (file)
@@ -1,7 +1,7 @@
 #include "StdAfx.h"
 #include "MergeApp.h"
 #include "Merge.h"
-#include "version.h"
+#include "VersionInfo.h"
 #include "paths.h"
 #include "Constants.h"
 #include "unicoder.h"
@@ -17,12 +17,12 @@ String GetSysError(int nerr /* =-1 */)
                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;
@@ -76,6 +76,16 @@ String tr(const std::string &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);
@@ -142,6 +152,12 @@ AboutInfo::AboutInfo()
 {
        CVersionInfo verinfo;
        version = strutils::format_string1(_("Version %1"), verinfo.GetProductVersion());
+       private_build = verinfo.GetPrivateBuild();
+       if (!private_build.empty())
+       {
+               version += _T(" + ") + private_build;
+       }
+
        if (version.find(_T(" - ")) != String::npos)
        {
                strutils::replace(version, _T(" - "), _T("\n"));
@@ -151,24 +167,22 @@ AboutInfo::AboutInfo()
        {
                version += _T("\n");
        }
-#ifdef _UNICODE
-       version += _T(" ");
-       version += _("Unicode");
-#endif
 
 #if defined _M_IX86
        version += _T(" ");
-       version += _("x86");
+       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
 
 #if defined _DEBUG
        version += _T(" (");
-       version += _("Debug");
+       version += _T("Debug");
        version += _T(")");
 #endif
 
@@ -177,14 +191,5 @@ AboutInfo::AboutInfo()
        copyright += verinfo.GetLegalCopyright();
        copyright += _T(" - All rights reserved.");
 
-       private_build = verinfo.GetPrivateBuild();
-       if (!private_build.empty())
-       {
-               private_build = strutils::format_string1(_("Private Build: %1"), private_build);
-       }
-
        website = WinMergeURL;
-
-       developers = _("Developers:\nDean Grimm, Christian List, Kimmo Varis, Jochen Tucht, Tim Gerundt, Takashi Sawanaki, Gal Hammer, Alexander Skinner");
-       strutils::replace(developers, _T(", "), _T("\n"));
 }