[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim] kmail: Fix i18n plural handling based on list of distribution list names
From: Kevin Krammer <kevin.krammer () gmx ! at>
Date: 2012-02-08 10:19:30
Message-ID: 20120208101930.C6C50A60A6 () git ! kde ! org
[Download RAW message or body]
Git commit 49e6f2cd660f1cb4bb555af5dccb04ff350de076 by Kevin Krammer.
Committed on 08/02/2012 at 11:15.
Pushed by krake into branch 'master'.
Fix i18n plural handling based on list of distribution list names
Solution provided by Albert Astals Cid: use list count as plural deciding
factor but do not use it for placeholder substitution.
BUG: 274678
REVIEW: 103889
M +9 -12 kmail/addressvalidationjob.cpp
http://commits.kde.org/kdepim/49e6f2cd660f1cb4bb555af5dccb04ff350de076
diff --git a/kmail/addressvalidationjob.cpp b/kmail/addressvalidationjob.cpp
index a3fb770..b557d1b 100644
--- a/kmail/addressvalidationjob.cpp
+++ b/kmail/addressvalidationjob.cpp
@@ -67,19 +67,16 @@ void AddressValidationJob::Private::slotAliasExpansionDone( KJob \
*job ) if ( !emptyDistributionLists.isEmpty() ) {
QString errorMsg;
const int numberOfDistributionList( emptyDistributionLists.count() );
- if ( numberOfDistributionList == 1 ) {
- errorMsg = i18n( "Distribution list \"%1\" is empty, it cannot be used.",
- emptyDistributionLists.first() );
- } else {
- QString listOfDistributionList;
- for ( int i = 0; i < numberOfDistributionList; ++i )
- {
- if ( i != 0 )
- listOfDistributionList.append( ", " );
- listOfDistributionList.append( QString::fromLatin1( "\"%1\"" ).arg( \
emptyDistributionLists.at( i ) ) );
- }
- errorMsg = i18n( "Distributions lists %1 are empty, they cannot be used.", \
listOfDistributionList ); + QString listOfDistributionList;
+ for ( int i = 0; i < numberOfDistributionList; ++i )
+ {
+ if ( i != 0 )
+ listOfDistributionList.append( ", " );
+ listOfDistributionList.append( QString::fromLatin1( "\"%1\"" ).arg( \
emptyDistributionLists.at( i ) ) ); }
+ errorMsg = i18np( "Distribution list %2 is empty, it cannot be used.",
+ "Distribution lists %2 are empty, they cannot be used.",
+ numberOfDistributionList, listOfDistributionList );
KMessageBox::sorry( mParentWidget, errorMsg, i18n( "Invalid Email Address" ) );
mIsValid = false;
} else {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic