Qt: Fix plural translations
authorStig Bjørlykke <stig@bjorlykke.org>
Wed, 10 Feb 2016 19:36:23 +0000 (20:36 +0100)
committerStig Bjørlykke <stig@bjorlykke.org>
Wed, 10 Feb 2016 20:02:44 +0000 (20:02 +0000)
Change-Id: I17df0c0a3462b7ccdda2105204c0ad72e80fc175
Reviewed-on: https://code.wireshark.org/review/13882
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
ui/qt/file_set_dialog.cpp
ui/qt/main_window_slots.cpp
ui/qt/wireshark_en.ts

index 506b58fa1057e923c2688d377c027d32e319012d..7151437de49707c3c5569589228eca318f5aeba1 100644 (file)
@@ -123,9 +123,8 @@ void FileSetDialog::addFile(fileset_entry *entry) {
     // Not perfect but better than nothing.
     entry_item->setTextAlignment(3, Qt::AlignRight);
 
-    setWindowTitle(wsApp->windowTitleString(tr("%1 File%2 in Set")
-                                            .arg(fs_ui_->fileSetTree->topLevelItemCount())
-                                            .arg(plurality(fs_ui_->fileSetTree->topLevelItemCount(), "", "s"))));
+    setWindowTitle(wsApp->windowTitleString(tr("%Ln File(s) in Set", "",
+                                            fs_ui_->fileSetTree->topLevelItemCount())));
 
     dir_name = fileset_get_dirname();
     fs_ui_->directoryLabel->setText(dir_name);
index 0c163f7de8781a41b6b1fd0f9e0cbb4a821ed145..cee9deae9a4ab6e3eb3f5f9c3295e1ec5522efb3 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "wsutil/file_util.h"
 #include "wsutil/filesystem.h"
-#include "wsutil/str_util.h"
 
 #include "epan/addr_resolv.h"
 #include "epan/dissector_filters.h"
@@ -1803,8 +1802,7 @@ void MainWindow::on_actionFileExportSSLSessionKeys_triggered()
         return;
     }
 
-    save_title.append(wsApp->windowTitleString(tr("Export SSL Session Keys (%1 key%2").
-            arg(keylist_len).arg(plurality(keylist_len, "", "s"))));
+    save_title.append(wsApp->windowTitleString(tr("Export SSL Session Keys (%Ln key(s))", "", keylist_len)));
     file_name = QFileDialog::getSaveFileName(this,
                                              save_title,
                                              wsApp->lastOpenDir().canonicalPath(),
index 979a7adb8b703bca05f5d754a0548a4aa3a9409c..aa26f727b39a03214edacbc8688aec64c42f81c3 100644 (file)
@@ -2502,10 +2502,14 @@ PLEASE NOTE: One option MUST be selected.</source>
         <source>Open this capture file</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
+    <message numerus="yes">
         <location filename="file_set_dialog.cpp" line="126"/>
-        <source>%1 File%2 in Set</source>
-        <translation type="unfinished"></translation>
+        <source>%Ln File(s) in Set</source>
+        <oldsource>%1 File%2 in Set</oldsource>
+        <translation>
+            <numerusform>%Ln File in Set</numerusform>
+            <numerusform>%Ln Files in Set</numerusform>
+        </translation>
     </message>
 </context>
 <context>
@@ -2737,17 +2741,17 @@ for filter files: %2.</source>
     <message numerus="yes">
         <location filename="follow_stream_dialog.cpp" line="169"/>
         <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;client&lt;/span&gt; pkt(s), </source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
+        <translation>
+            <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;client&lt;/span&gt; pkt, </numerusform>
+            <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;client&lt;/span&gt; pkts, </numerusform>
         </translation>
     </message>
     <message numerus="yes">
         <location filename="follow_stream_dialog.cpp" line="172"/>
         <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;server&lt;/span&gt; pkt(s), </source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
+        <translation>
+            <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;server&lt;/span&gt; pkt, </numerusform>
+            <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;server&lt;/span&gt; pkts, </numerusform>
         </translation>
     </message>
     <message numerus="yes">
@@ -9188,10 +9192,14 @@ a:hover {
         <source>There are no SSL Session Keys to save.</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location filename="main_window_slots.cpp" line="1798"/>
-        <source>Export SSL Session Keys (%1 key%2</source>
-        <translation type="unfinished"></translation>
+    <message numerus="yes">
+        <location filename="main_window_slots.cpp" line="1805"/>
+        <source>Export SSL Session Keys (%Ln key(s))</source>
+        <oldsource>Export SSL Session Keys (%1 key%2</oldsource>
+        <translation>
+            <numerusform>Export SSL Session Keys (%Ln key)</numerusform>
+            <numerusform>Export SSL Session Keys (%Ln keys)</numerusform>
+        </translation>
     </message>
     <message>
         <location filename="main_window_slots.cpp" line="1803"/>