comparison 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
comparison
equal deleted inserted replaced
154:6bcb4a4d6521 155:edab92f3ea0b
316 316
317 QStringList files = hgTabs->getSelectedCommittableFiles(); 317 QStringList files = hgTabs->getSelectedCommittableFiles();
318 QStringList reportFiles = files; 318 QStringList reportFiles = files;
319 if (reportFiles.empty()) reportFiles = hgTabs->getAllCommittableFiles(); 319 if (reportFiles.empty()) reportFiles = hgTabs->getAllCommittableFiles();
320 320
321 QString cf(tr("Commit files"));
322
321 if (ConfirmCommentDialog::confirmAndGetLongComment 323 if (ConfirmCommentDialog::confirmAndGetLongComment
322 (this, 324 (this,
323 tr("Commit files"), 325 cf,
324 tr("<h3>Commit files</h3><p>You are about to commit the following files:"), 326 tr("<h3>%1</h3><p>%2").arg(cf)
325 tr("<h3>Commit files</h3><p>You are about to commit %1 files."), 327 .arg(tr("You are about to commit the following files:")),
328 tr("<h3>%1</h3><p>%2").arg(cf)
329 .arg(tr("You are about to commit %n file(s):", "", reportFiles.size())),
326 reportFiles, 330 reportFiles,
327 comment)) { 331 comment)) {
328 332
329 if ((justMerged == false) && //!!! review usage of justMerged, and how it interacts with asynchronous request queue 333 if ((justMerged == false) && //!!! review usage of justMerged, and how it interacts with asynchronous request queue
330 !files.empty()) { 334 !files.empty()) {
516 QStringList params; 520 QStringList params;
517 QString comment; 521 QString comment;
518 522
519 QStringList files = hgTabs->getSelectedRevertableFiles(); 523 QStringList files = hgTabs->getSelectedRevertableFiles();
520 if (files.empty()) files = hgTabs->getAllRevertableFiles(); 524 if (files.empty()) files = hgTabs->getAllRevertableFiles();
525
526 QString rf(tr("Revert files"));
521 527
522 if (ConfirmCommentDialog::confirmDangerousFilesAction 528 if (ConfirmCommentDialog::confirmDangerousFilesAction
523 (this, 529 (this,
524 tr("Revert files"), 530 rf,
525 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:"), 531 tr("<h3>%1</h3><p>%2").arg(rf)
526 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."), 532 .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:")),
533 tr("<h3>%1</h3><p>%2").arg(rf)
534 .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())),
527 files)) { 535 files)) {
528 536
529 if (files.empty()) { 537 if (files.empty()) {
530 params << "revert" << "--no-backup"; 538 params << "revert" << "--no-backup";
531 } else { 539 } else {