diff mainwindow.cpp @ 155:edab92f3ea0b

* Add translation support -- useful for proper plural handling even in English
author Chris Cannam
date Thu, 02 Dec 2010 21:13:53 +0000
parents 6bcb4a4d6521
children 4999dbf3a266
line wrap: on
line diff
--- a/mainwindow.cpp	Thu Dec 02 18:04:21 2010 +0000
+++ b/mainwindow.cpp	Thu Dec 02 21:13:53 2010 +0000
@@ -318,11 +318,15 @@
     QStringList reportFiles = files;
     if (reportFiles.empty()) reportFiles = hgTabs->getAllCommittableFiles();
 
+    QString cf(tr("Commit files"));
+
     if (ConfirmCommentDialog::confirmAndGetLongComment
         (this,
-         tr("Commit files"),
-         tr("<h3>Commit files</h3><p>You are about to commit the following files:"),
-         tr("<h3>Commit files</h3><p>You are about to commit %1 files."),
+         cf,
+         tr("<h3>%1</h3><p>%2").arg(cf)
+         .arg(tr("You are about to commit the following files:")),
+         tr("<h3>%1</h3><p>%2").arg(cf)
+         .arg(tr("You are about to commit %n file(s):", "", reportFiles.size())),
          reportFiles,
          comment)) {
 
@@ -518,12 +522,16 @@
 
     QStringList files = hgTabs->getSelectedRevertableFiles();
     if (files.empty()) files = hgTabs->getAllRevertableFiles();
+
+    QString rf(tr("Revert files"));
     
     if (ConfirmCommentDialog::confirmDangerousFilesAction
         (this,
-         tr("Revert files"),
-         tr("<h3>Revert files</h3><p>You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed:"),
-         tr("<h3>Revert files</h3><p>You are about to <b>revert</b> %1 files.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed."),
+         rf,
+         tr("<h3>%1</h3><p>%2").arg(rf)
+         .arg(tr("You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed:")),
+         tr("<h3>%1</h3><p>%2").arg(rf)
+         .arg(tr("You are about to <b>revert</b> %n file(s).<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed.", "", files.size())),
          files)) {
         
         if (files.empty()) {