Bug 96797 - incorrect i18n plural handling by akregator and its konq-plugin
Summary: incorrect i18n plural handling by akregator and its konq-plugin
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-11 20:02 UTC by Gregory Mokhin
Modified: 2012-05-14 12:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Mokhin 2005-01-11 20:02:42 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

There are several places in akregator code that don't use KDE infrastructure for plural forms handling (i.e. assuming that only "one" and "many" exist). Examples:

src/propertieswidgetbase.ui:
1) Delete articles older than %1 days. 
2) Limit archive to: ... article(s) 
3) Fetch feeds every ... minute(s)  

trayicon.cpp: 
aKregator - %1 unread

That breaks translation for most of the languages that use different number of plurals.
Comment 1 Teemu Rytilahti 2005-01-16 17:33:26 UTC
What's wrong in that trayicon one? Isn't "aKregator - 1 unread" proper?
Comment 2 Gregory Mokhin 2005-01-16 18:01:49 UTC
Of course, not. In languages other than English translation for the "unread" depends on the number. This is called "Plural handling".

http://developer.kde.org/documentation/library/kdeqt/kde3arch/kde-i18n-howto.html#SECTION00031000000000000000

Read the short section on Plural handling.

Here is the reference for the correct form of i18n() for plural handling.

http://developer.kde.org/documentation/library/cvs-api/kdecore/html/classKLocale.html#m4
Comment 3 Lukáš Tinkl 2005-01-17 11:20:59 UTC
CVS commit by lukas: 

handle plural properly

BUG: 96797


  M +6 -6      trayicon.cpp   1.27


--- kdepim/akregator/src/trayicon.cpp  #1.26:1.27
@@ -124,14 +124,14 @@ void TrayIcon::slotSetUnread(int unread)
     
     m_unread=unread;
+    
         QToolTip::remove(this);
+    QToolTip::add(this, i18n("aKregator - 1 unread article", "aKregator - %n unread articles", unread));
+    
     if (unread == 0)
     {
-        QToolTip::add(this, i18n("aKregator - No unread articles"));
         setPixmap(m_defaultIcon);
     }
     else
     {           
-        QToolTip::add(this, i18n("aKregator - %1 unread").arg(unread));
-        
         // from KMSystemTray
         int oldW = pixmap()->size().width();


Comment 4 Gregory Mokhin 2005-01-18 04:12:51 UTC
Cool, thanks. What about fixing issues in .ui file?
Comment 5 Teemu Rytilahti 2005-01-25 23:53:51 UTC
Umh, well, at least "no unread articles" sounds better than "0 unread articles" in Finnish, but okay, that's fine for me.
Comment 6 Heinrich Wendel 2005-06-22 15:45:32 UTC
the ui file was fixed 9 month ago: http://webcvs.kde.org/kdepim/akregator/src/propertieswidgetbase.ui?r1=1.15&r2=1.16
Comment 7 Gregory Mokhin 2005-06-22 16:21:02 UTC
Do you think that "one" and "many" are the only two possibilities for plural?  I'd recommend you to read again i18n HOWTO. This bug hits two bad practices of i18n-illiterate developers: splitting the translatable sentence into separate strings and being ignorant of the fact that most of the languages have several plural forms. Reopening the bug - it still exists in trunk.
Comment 8 Heinrich Wendel 2005-06-22 17:50:32 UTC
sorry, i don't see the point. can you please be more specific where the problem is currently.
Comment 10 Heinrich Wendel 2005-06-22 18:07:27 UTC
and where exactly is it not handled this way? point 1,2 and 3 of the reporter do it correctly.
Comment 11 Gregory Mokhin 2005-06-22 18:32:14 UTC
They do it correctly in English. English has two forms for plurals. In Russian there are 3 forms for plurals, so the translations for 21 days, 22 days, 28 days are all different. Other languages can have up to 6 plural forms, I guess.
Comment 12 Heinrich Wendel 2005-06-22 20:39:58 UTC
so in the end it's no bug in agregator but a feature request for kintspinbox
Comment 13 Robert Gomułka 2006-02-21 22:07:38 UTC
I can confirm it in my version. In configuration I can specify frequency of fetching RSSes. In my (Polish) language I have 3 plural forms, but in translation source I can see only one form (msgstr: minute). What is weird, though, that 1 minute is in its separate msgstr :\ I would expect rather something like:
msgstr:
_n: 1 minute\n
%n minutes

which would then be translated into:
1 minutę\n
%n minuty\n
%n minut\n

I hope my comment would be useful.
Comment 14 Christophe Marin 2012-05-14 12:23:21 UTC
The points mentioned by the bug reporter are fixed since ages now. 

If you find other plural issues with recent versions, please open a new report.