From e2c70a8bf0497d238dfa4dc704943a04b7789a34 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Tue, 10 Jun 2008 19:16:26 +0000 Subject: [PATCH] Added proper plural handling for PO files svn path=/trunk/; revision=852 --- ChangeLog | 8 ++++++++ src/Dialog_Progress.cc | 10 ++++++---- src/Win_GParted.cc | 23 ++++++++++++++--------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4725ded7..ebb73a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-10 Curtis Gedak + + * src/Dialog_Progress.cc: Added proper PO file plural handling. + - fixed a few spelling errors. + + * src/Win_GParted.cc: Added proper PO file plural handling. + - Closes GParted bug #315291 + 2008-05-10 Curtis Gedak * README: Removed absolute requirement for hal-lock. diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index 41ace436..6298fbe7 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 Bart +/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Bart Hakvoort * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -236,7 +236,7 @@ void Dialog_Progress::on_signal_show() if ( cancel ) { - progressbar_current .set_text( _("Operation canceled") ) ; + progressbar_current .set_text( _("Operation cancelled") ) ; progressbar_current .set_fraction( 0.0 ) ; } else @@ -253,7 +253,9 @@ void Dialog_Progress::on_signal_show() str_temp = _("All operations successfully completed") ; if ( warnings > 0 ) - str_temp += " (" + String::ucompose( _("%1 warnings"), warnings ) + ")" ; + str_temp += " (" + + String::ucompose( ngettext("%1 warning", "%1 warnings", warnings), warnings ) + + ")" ; progressbar_all .set_text( str_temp ) ; progressbar_all .set_fraction( 1.0 ) ; @@ -313,7 +315,7 @@ void Dialog_Progress::on_cancel() Gtk::BUTTONS_NONE, true ) ; - dialog .set_secondary_text( _("Canceling an operation may cause SEVERE filesystem damage.") ) ; + dialog .set_secondary_text( _("Cancelling an operation may cause SEVERE file system damage.") ) ; dialog .add_button( _("Continue Operation"), Gtk::RESPONSE_NONE ) ; dialog .add_button( _("Cancel Operation"), Gtk::RESPONSE_CANCEL ) ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 56c82832..d30fe587 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -667,10 +667,13 @@ void Win_GParted::Refresh_Visual() //set new statusbartext statusbar .pop() ; - if ( operations .size() != 1 ) - statusbar .push( String::ucompose( _("%1 operations pending"), operations .size() ) ); - else - statusbar .push( _( "1 operation pending" ) ); + statusbar .push( String::ucompose( ngettext( "%1 operation pending" + , "%1 operations pending" + , operations .size() + ) + , operations .size() + ) + ); if ( ! operations .size() ) allow_undo_clear_apply( false ) ; @@ -724,11 +727,13 @@ bool Win_GParted::Quit_Check_Operations() Gtk::BUTTONS_NONE, true ); - if ( operations .size() != 1 ) - dialog .set_secondary_text( String::ucompose( _("%1 operations are currently pending."), - operations .size() ) ) ; - else - dialog .set_secondary_text( _("1 operation is currently pending.") ) ; + dialog .set_secondary_text( String::ucompose( ngettext( "%1 operation is currently pending." + , "%1 operations are currently pending." + , operations .size() + ) + , operations .size() + ) + ) ; dialog .add_button( Gtk::Stock::QUIT, Gtk::RESPONSE_CLOSE ); dialog .add_button( Gtk::Stock::CANCEL,Gtk::RESPONSE_CANCEL );