OSDN Git Service

Fix report generation process. (#1324)
authorJun Tajima <56220423+tjmprm77@users.noreply.github.com>
Thu, 5 May 2022 09:48:53 +0000 (18:48 +0900)
committerGitHub <noreply@github.com>
Thu, 5 May 2022 09:48:53 +0000 (18:48 +0900)
- Fix an issue where the middle directory is not output in the title of the directory compare report for three directories.

42 files changed:
Src/Common/UnicodeString.cpp
Src/Common/UnicodeString.h
Src/DirCmpReport.cpp
Src/Merge.rc
Src/resource.h
Translations/WinMerge/Arabic.po
Translations/WinMerge/Basque.po
Translations/WinMerge/Brazilian.po
Translations/WinMerge/Bulgarian.po
Translations/WinMerge/Catalan.po
Translations/WinMerge/ChineseSimplified.po
Translations/WinMerge/ChineseTraditional.po
Translations/WinMerge/Corsican.po
Translations/WinMerge/Croatian.po
Translations/WinMerge/Czech.po
Translations/WinMerge/Danish.po
Translations/WinMerge/Dutch.po
Translations/WinMerge/English.pot
Translations/WinMerge/Finnish.po
Translations/WinMerge/French.po
Translations/WinMerge/Galician.po
Translations/WinMerge/German.po
Translations/WinMerge/Greek.po
Translations/WinMerge/Hungarian.po
Translations/WinMerge/Italian.po
Translations/WinMerge/Japanese.po
Translations/WinMerge/Korean.po
Translations/WinMerge/Lithuanian.po
Translations/WinMerge/Norwegian.po
Translations/WinMerge/Persian.po
Translations/WinMerge/Polish.po
Translations/WinMerge/Portuguese.po
Translations/WinMerge/Romanian.po
Translations/WinMerge/Russian.po
Translations/WinMerge/Serbian.po
Translations/WinMerge/Sinhala.po
Translations/WinMerge/Slovak.po
Translations/WinMerge/Slovenian.po
Translations/WinMerge/Spanish.po
Translations/WinMerge/Swedish.po
Translations/WinMerge/Turkish.po
Translations/WinMerge/Ukrainian.po

index 04f609a..e5f6e8b 100644 (file)
@@ -289,4 +289,18 @@ String format_string2(const String& fmt, const String& arg1, const String& arg2)
        return format_strings(fmt, args, 2);
 }
 
+/**
+ * @brief Output the converted string according to the printf()-style formatting.
+ * @param [in] fmt printf()-style formatting.
+ * @param [in] arg1 Value of "%1" of fmt.
+ * @param [in] arg2 Value of "%2" of fmt.
+ * @param [in] arg3 Value of "%3" of fmt.
+ * @return Formatted output string.
+ */
+String format_string3(const String& fmt, const String& arg1, const String& arg2, const String& arg3)
+{
+       const String* args[] = { &arg1, &arg2, &arg3 };
+       return format_strings(fmt, args, 3);
+}
+
 }
index b9f7207..716c61c 100644 (file)
@@ -65,6 +65,7 @@ inline String format(String const & fmt, Args const & ... args)
 String format_strings(const String& fmt, const String *args[], size_t nargs);
 String format_string1(const String& fmt, const String& arg1);
 String format_string2(const String& fmt, const String& arg1, const String& arg2);
+String format_string3(const String& fmt, const String& arg1, const String& arg2, const String& arg3);
 
 template <class InputIterator>
 String join(const InputIterator& begin, const InputIterator& end, const String& delim)
index 412bfbf..5454a11 100644 (file)
@@ -87,13 +87,24 @@ void DirCmpReport::SetList(IListCtrl *pList)
 
 /**
  * @brief Set root-paths of current compare so we can add them to report.
+ * @param [in] paths Root path information for the directory for which the report is generated.
  */
 void DirCmpReport::SetRootPaths(const PathContext &paths)
 {
-       m_rootPaths.SetLeft(paths.GetLeft());
-       m_rootPaths.SetRight(paths.GetRight());
-       m_sTitle = strutils::format_string2(_("Compare %1 with %2"),
-               m_rootPaths.GetLeft(), m_rootPaths.GetRight());
+       if (paths.GetSize() < 3)
+       {
+               m_rootPaths.SetLeft(paths.GetLeft());
+               m_rootPaths.SetRight(paths.GetRight());
+               m_sTitle = strutils::format_string2(_("Compare %1 with %2"),
+                       m_rootPaths.GetLeft(), m_rootPaths.GetRight());
+       }
+       else {
+               m_rootPaths.SetLeft(paths.GetLeft());
+               m_rootPaths.SetMiddle(paths.GetMiddle());
+               m_rootPaths.SetRight(paths.GetRight());
+               m_sTitle = strutils::format_string3(_("Compare %1 with %2 and %3"),
+                       m_rootPaths.GetLeft(), m_rootPaths.GetMiddle(), m_rootPaths.GetRight());
+       }
 }
 
 /**
@@ -443,8 +454,14 @@ void DirCmpReport::GenerateXmlHeader()
                                _T("<WinMergeDiffReport version=\"2\">\n")
                                _T("<left>"));
        WriteStringEntityAware(m_rootPaths.GetLeft());
-       WriteString(_T("</left>\n")
-                               _T("<right>"));
+       WriteString(_T("</left>\n"));
+       if (m_rootPaths.GetSize() == 3)
+       {
+               WriteString(_T("<middle>"));
+               WriteStringEntityAware(m_rootPaths.GetMiddle());
+               WriteString(_T("</middle>\n"));
+       }
+       WriteString(_T("<right>"));
        WriteStringEntityAware(m_rootPaths.GetRight());
        WriteString(_T("</right>\n")
                                _T("<time>"));
index c10949d..bc1b06a 100644 (file)
@@ -3655,6 +3655,7 @@ END
 STRINGTABLE\r
 BEGIN\r
     IDS_DIRECTORY_REPORT_TITLE "Compare %1 with %2"\r
+    IDS_DIRECTORY_REPORT_TITLE3 "Compare %1 with %2 and %3"\r
     IDS_REPORT_COMMALIST    "Comma-separated list"\r
     IDS_REPORT_TABLIST      "Tab-separated list"\r
     IDS_REPORT_SIMPLEHTML   "Simple HTML"\r
index 5ae345c..7c62481 100644 (file)
 #define IDS_PRPCAT_VIDEO                41971\r
 #define IDS_PRPCAT_HASH                 41972\r
 #define IDS_DIRECTORY_REPORT_TITLE      41980\r
+#define IDS_DIRECTORY_REPORT_TITLE3     41981\r
 #define IDS_REPORT_COMMALIST            41990\r
 #define IDS_REPORT_TABLIST              41991\r
 #define IDS_REPORT_SIMPLEHTML           41992\r
index 43d94ac..e0f84a8 100644 (file)
@@ -3226,6 +3226,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "قارن بين %1 و %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "قائمة مرتبة بالفاصلة"
 
index d4267b0..bc238a5 100644 (file)
@@ -3822,6 +3822,10 @@ msgid "Compare %1 with %2"
 msgstr "Alderatu %1 %2-rekin"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Kakotxaz banandutako zerrenda"
 
index 2252f0c..3ade6f0 100644 (file)
@@ -3290,6 +3290,10 @@ msgstr "Nome ou tubulação do plugin do pré-diferenciamento."
 msgid "Compare %1 with %2"
 msgstr "Comparar o %1 com o %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Lista separada por vírgula"
 
index 7f6cda5..0ce2b66 100644 (file)
@@ -3269,6 +3269,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "Сравняване на %1 с %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Списък, разделен със запетая"
 
index 25b835a..975afdc 100644 (file)
@@ -3871,6 +3871,10 @@ msgid "Compare %1 with %2"
 msgstr "Compara %1 amb %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Llista delimitada per comes"
 
index c2cdb7b..dac1e75 100644 (file)
@@ -3248,6 +3248,10 @@ msgstr "预比较插件名称或流程(pipeline)。"
 msgid "Compare %1 with %2"
 msgstr "比较 %1 和 %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "逗号分隔的列表"
 
index 1cfabc1..f04c952 100644 (file)
@@ -3885,6 +3885,10 @@ msgid "Compare %1 with %2"
 msgstr "比較 %1 和 %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "逗號分隔列表"
 
index f249f50..f5aa80f 100644 (file)
@@ -3255,6 +3255,10 @@ msgstr "Nome o cundottu di u modulu d’estensione di u preparagone."
 msgid "Compare %1 with %2"
 msgstr "Paragunà %1 cù %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Lista staccata da virgule"
 
index 4df3511..dd54297 100644 (file)
@@ -3820,6 +3820,10 @@ msgid "Compare %1 with %2"
 msgstr "Usporedi %1 s %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Popis odvojen zarezom"
 
index 2c84d2f..f456ce3 100644 (file)
@@ -3767,6 +3767,10 @@ msgid "Compare %1 with %2"
 msgstr "Porovnání %1 s %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Seznam oddělený čárkami"
 
index bdc37bc..1ec9938 100644 (file)
@@ -3846,6 +3846,10 @@ msgid "Compare %1 with %2"
 msgstr "Sammenlign %1 med %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Komma opdelt liste"
 
index c5eeb13..216ff35 100644 (file)
@@ -3274,6 +3274,10 @@ msgstr "Voorvergelijking pluginnaam of pipeline"
 msgid "Compare %1 with %2"
 msgstr "%1 met %2 vergelijken"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Komma-gescheiden lijst"
 
index 71e62e6..f07c842 100644 (file)
@@ -5,7 +5,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WinMerge\n"
 "Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n"
-"POT-Creation-Date: 2022-05-03 20:07+0000\n"
+"POT-Creation-Date: 2022-05-05 12:15+0000\n"
 "PO-Revision-Date: \n"
 "Last-Translator: \n"
 "Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"
@@ -3000,6 +3000,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr ""
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr ""
 
index a3c4b96..409b751 100644 (file)
@@ -3842,6 +3842,10 @@ msgid "Compare %1 with %2"
 msgstr "Vertaa %1 -> %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Pilkuilla erotettu lista"
 
index 863dce8..5018496 100644 (file)
@@ -3898,6 +3898,10 @@ msgid "Compare %1 with %2"
 msgstr "Comparer %1 avec %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Liste délimitée par des virgules"
 
index f6adb1d..3f73501 100644 (file)
@@ -3890,6 +3890,10 @@ msgid "Compare %1 with %2"
 msgstr "Comparar %1 con %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Listaxe separada por comas"
 
index 5ab24d9..1342275 100644 (file)
@@ -3653,6 +3653,10 @@ msgid "Compare %1 with %2"
 msgstr "%1 mit %2 vergleichen"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Komma-getrennte Liste"
 
index fe99f68..3a9e42b 100644 (file)
@@ -3798,6 +3798,10 @@ msgid "Compare %1 with %2"
 msgstr "Σύγκριση %1 με %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Κατάλογος με κόμμα ως χαρακτήρα διαχωρισμού"
 
index 6d9e1f6..1821f6b 100644 (file)
@@ -3879,6 +3879,10 @@ msgid "Compare %1 with %2"
 msgstr "%1 összehasonlítása ezzel: %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Vesszővel elválasztott lista"
 
index 6f63491..280ea00 100644 (file)
@@ -3234,6 +3234,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "Confronta %1 con %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Elenco separato da virgole"
 
index b6b278c..1a1307b 100644 (file)
@@ -3245,6 +3245,10 @@ msgstr "比較前処理プラグイン名またはパイプラインを表示し
 msgid "Compare %1 with %2"
 msgstr "%1 と %2 の比較"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr "%1 と %2 および %3 の比較"
+
 msgid "Comma-separated list"
 msgstr "CSV 形式"
 
index 2f81ec6..4c7df1d 100644 (file)
@@ -3883,6 +3883,10 @@ msgid "Compare %1 with %2"
 msgstr "%1을 %2와 비교"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "쉼표로 분리된 목록"
 
index b7dcf22..446fe3a 100644 (file)
@@ -3006,6 +3006,10 @@ msgstr "Paruošėjo papildinio pavadinimas arba komandų grandinė."
 msgid "Compare %1 with %2"
 msgstr "Lyginti %1 su %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Kableliais sudalintas sąrašas"
 
index 5874901..2c8655f 100644 (file)
@@ -3260,6 +3260,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "Sammenligning %1 med %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Komma-separert liste"
 
index 735075a..4975bff 100644 (file)
@@ -3854,6 +3854,10 @@ msgid "Compare %1 with %2"
 msgstr " همسنجي  %1 با  %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr " فهرستي که با کاما جدا شده باشد "
 
index 552366e..72f5d99 100644 (file)
@@ -3007,6 +3007,10 @@ msgstr "Nazwa wtyczki porównywającej lub pipeline."
 msgid "Compare %1 with %2"
 msgstr "Porównaj %1 z %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Lista z przecinkami"
 
index d45c20f..b68de47 100644 (file)
@@ -3247,6 +3247,10 @@ msgstr "Pré-diferenciar nome de plugin ou pipeline."
 msgid "Compare %1 with %2"
 msgstr "Comparar %1 com %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Lista separada por vírgulas"
 
index fd97aba..08a1256 100644 (file)
@@ -3802,6 +3802,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "Compară %1 cu %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 #, fuzzy, c-format
 msgid "Comma-separated list"
 msgstr "Listă separată-de-virgule"
index 97d899f..1c809b8 100644 (file)
@@ -3008,6 +3008,10 @@ msgstr "Имя плагина предсравнения или конвейер
 msgid "Compare %1 with %2"
 msgstr "Сравнение %1 с %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Список с разделителем Запятая"
 
index c84ee44..d2bc86d 100644 (file)
@@ -3795,6 +3795,10 @@ msgid "Compare %1 with %2"
 msgstr "Упореди %1 са %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Списак је одвојен зарезом"
 
index 67e5098..6ae4c06 100644 (file)
@@ -3815,6 +3815,10 @@ msgid "Compare %1 with %2"
 msgstr "Compare %1 with %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Comma-separated list"
 
index 159b4ce..093431c 100644 (file)
@@ -3238,6 +3238,10 @@ msgstr "Názov rozšírenia predbežného spracovateľa rozdielov alebo potrubia
 msgid "Compare %1 with %2"
 msgstr "Porovnať %1 s %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Zoznam oddelený čiarkami"
 
index 32f92ba..f4fd0ba 100644 (file)
@@ -3246,6 +3246,10 @@ msgstr "Ime vtičnika predrazlikovalca ali cevovod."
 msgid "Compare %1 with %2"
 msgstr "Primerjaj %1 z %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Seznam, ločen z vejicami"
 
index 81eb070..7d30c24 100644 (file)
@@ -3248,6 +3248,10 @@ msgstr ""
 msgid "Compare %1 with %2"
 msgstr "Comparar %1 con %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Lista separada por comas"
 
index 33f347f..f3119e6 100644 (file)
@@ -3239,6 +3239,10 @@ msgstr "Namn eller rörslinga för PreDiffer (tillägg)"
 msgid "Compare %1 with %2"
 msgstr "Jämför %1 med %2"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Kommaseparerad lista"
 
index 750dbc9..bd79961 100644 (file)
@@ -3295,6 +3295,10 @@ msgstr "Ön farklılaştırıcı eklentisi adı ya da bağlantı yolu."
 msgid "Compare %1 with %2"
 msgstr "%1 ile %2 ögesini karşılaştır"
 
+#, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
 msgid "Comma-separated list"
 msgstr "Virgül ile ayrılmış liste"
 
index 6b13cba..d7afaa2 100644 (file)
@@ -3823,6 +3823,10 @@ msgid "Compare %1 with %2"
 msgstr "Порівняння %1 з %2"
 
 #, c-format
+msgid "Compare %1 with %2 and %3"
+msgstr ""
+
+#, c-format
 msgid "Comma-separated list"
 msgstr "Список, розділений комами"