Version: (using KDE KDE 3.0.99) Installed from: Compiled From Sources Compiler: gcc version 2.95.4 20011002 (Debian prerelease) OS: Linux 1) In "Interupts" module the text from KListView header, namely "Interupts" is fixed font, instead of KDE default font (usualy helvetica/arial) 2) In "X Server" information module you reffer to "bit" and "byte", but there are plural form here. So, you should add "bit" and "bits" when bit>1 and bit=1. Same for "byte" suffix, altough I don't indetified yet where byte may be used as singular form.
Subject: kdebase/kcontrol/info CVS commit by deller: CCMAIL: 52640-done@bugs.kde.org Fix default font usage of listbox headers, closes bug #52640. M +3 -2 info.cpp 1.58 --- kdebase/kcontrol/info/info.cpp #1.57:1.58 @@ -5,5 +5,5 @@ (But all functions in THIS FILE should be system independent !) - (C) 1998-2002 by Helge Deller <deller@kde.org> + (C) 1998-2003 by Helge Deller <deller@kde.org> ** main.cpp includes this file ! ** @@ -355,4 +355,5 @@ void KInfoListWidget::load() /* is the user allowed to use sorting ? */ lBox->header()->setClickEnabled(sorting_allowed); + lBox->header()->setFont(KGlobalSettings::generalFont()); lBox->setShowSortIndicator(sorting_allowed);
Subject: KDE_3_1_BRANCH: kdebase/kcontrol/info CVS commit by deller: CCMAIL: 52640@bugs.kde.org Backport: Fix default font usage of listbox headers, closes bug #52640. M +3 -2 info.cpp 1.56.2.1 --- kdebase/kcontrol/info/info.cpp #1.56:1.56.2.1 @@ -5,5 +5,5 @@ (But all functions in THIS FILE should be system independent !) - (C) 1998-2002 by Helge Deller <deller@kde.org> + (C) 1998-2003 by Helge Deller <deller@kde.org> ** main.cpp includes this file ! ** @@ -354,4 +354,5 @@ void KInfoListWidget::load() /* is the user allowed to use sorting ? */ lBox->header()->setClickEnabled(sorting_allowed); + lBox->header()->setFont(KGlobalSettings::generalFont()); lBox->setShowSortIndicator(sorting_allowed);
Hi Claudiu, Thanks for the bug report. The font-problem (1) should be fixed with the above commits in CVS HEAD and in the 3.1 BRANCH. Regarding (2) I don't agree with you. Looking at the strings I see e.g.: Pixmap Format #1 1 BPP, Depth: 1 Bit, scanline_pad: 32" and Pixmap Format #5 16 BPP, Depth: 16 Bit, scanline_pad: 32" and or Maximum Request Size 4 194 300 Byte IMHO, all of those look ok and "16 Bits" doesn't look more correct than "16 Bit". Greetings, Helge
Subject: Re: text font and i18n() problems Dear Helge, On Lun 06 Ian 2003 18:25, you wrote: [snip] > ------- Additional Comments From deller@kde.org 2003-01-06 17:25 ------- > Hi Claudiu, > > Thanks for the bug report. > > The font-problem (1) should be fixed with the above commits in CVS HEAD and > in the 3.1 BRANCH. > > Regarding (2) I don't agree with you. Looking at the strings I see e.g.: > Pixmap Format #1 1 BPP, Depth: 1 Bit, scanline_pad: 32" and > Pixmap Format #5 16 BPP, Depth: 16 Bit, scanline_pad: 32" and > or > Maximum Request Size 4 194 300 Byte > > IMHO, all of those look ok and "16 Bits" doesn't look more correct than "16 > Bit". For English speakers yes. But don't forget we _are_ translating this in our languages. See translation: English Romanian ---------------------- 1 Bit = 1 bit 16 Bit = 16 bi
OK, I'll fix this in HEAD soon. Helge
Subject: kdebase/kcontrol/info CVS commit by deller: CCMAIL: 52640-done@bugs.kde.org i18n changes: fix singular/plural forms of Bit/Bits & Byte/Bytes, closes BR 52460 M +27 -10 info.cpp 1.59 --- kdebase/kcontrol/info/info.cpp #1.58:1.59 @@ -71,5 +71,5 @@ static bool sorting_allowed; /* is sorti #define PIXEL_ADD 20 // add x Pixel to multicolumns.. -#define HEXDIGITS (sizeof(int)*8/4) /* 4 Byte = 32 Bit = 8 Hex-Digits */ +#define HEXDIGITS (sizeof(int)*8/4) /* 4 Bytes = 32 Bits = 8 Hex-Digits */ static QString Value( int val, int numbers=1 ) @@ -222,5 +222,5 @@ static QListViewItem* XServer_fill_scree } -QString Order( int order ) +static QString Order( int order ) { if (order==LSBFirst) return i18n("LSBFirst"); else @@ -229,5 +229,20 @@ QString Order( int order ) } -bool GetInfo_XServer_Generic( QListView *lBox ) +static QString BitString( unsigned long n ) +{ + return i18n("1 Bit", "%n Bits", n); // singular & plural form of "%d Bit" +} + +static QString ByteString( unsigned long n ) +{ + /* explanation in BR #52640 (http://bugs.kde.org/show_bug.cgi?id=52640) */ + if (n == 1) + return i18n("1 Byte"); // singular form: "1 Byte" (yes, it's "1", not "%1"!) + + return i18n("%1 Bytes") // plural form: "%1 Bytes" + .arg(KGlobal::locale()->formatNumber(n,0)); +} + +static bool GetInfo_XServer_Generic( QListView *lBox ) { /* Many parts of this source are taken from the X11-program "xdpyinfo" */ @@ -290,8 +305,10 @@ bool GetInfo_XServer_Generic( QListView last->setExpandable(true); for (i=0; i<n; i++) { - item = new QListViewItem(last, item, i18n("Pixmap Format #%1").arg(i+1), - i18n("%1 BPP, Depth: %2 Bit, scanline_pad: %3"). - arg(pmf[i].bits_per_pixel).arg(pmf[i].depth). - arg(pmf[i].scanline_pad)); + item = new QListViewItem(last, item, + i18n("Pixmap Format #%1").arg(i+1), + i18n("%1 BPP, Depth: %2, Scanline padding: %3") + .arg(pmf[i].bits_per_pixel) + .arg(BitString(pmf[i].depth)) + .arg(BitString(pmf[i].scanline_pad))); } XFree ((char *)pmf); @@ -301,7 +318,7 @@ bool GetInfo_XServer_Generic( QListView if (!req_size) req_size = XMaxRequestSize(dpy); last = new QListViewItem(next, last, i18n("Maximum Request Size"), - i18n("%1 Byte").arg(KGlobal::locale()->formatNumber(req_size*4,0))); + ByteString(req_size*4)); last = new QListViewItem(next, last, i18n("Motion Buffer Size"), - i18n("%1 Byte").arg(KGlobal::locale()->formatNumber(XDisplayMotionBufferSize(dpy), 0))); + ByteString(XDisplayMotionBufferSize(dpy))); last = item = new QListViewItem(next, last, i18n("Bitmap"));
Why not using standard plural forms (like in BitString) in ByteString? (In reply to comment #6) > Subject: kdebase/kcontrol/info > > CVS commit by deller: > > CCMAIL: 52640-done@bugs.kde.org > i18n changes: fix singular/plural forms of Bit/Bits & Byte/Bytes, > closes BR 52460 > > > M +27 -10 info.cpp 1.59 > > > --- kdebase/kcontrol/info/info.cpp #1.58:1.59 > @@ -71,5 +71,5 @@ static bool sorting_allowed; /* is sorti > #define PIXEL_ADD 20 // add x Pixel to multicolumns.. > > -#define HEXDIGITS (sizeof(int)*8/4) /* 4 Byte = 32 Bit = 8 Hex-Digits */ > +#define HEXDIGITS (sizeof(int)*8/4) /* 4 Bytes = 32 Bits = 8 Hex-Digits */ > > static QString Value( int val, int numbers=1 ) > @@ -222,5 +222,5 @@ static QListViewItem* XServer_fill_scree > } > > -QString Order( int order ) > +static QString Order( int order ) > { > if (order==LSBFirst) return i18n("LSBFirst"); else > @@ -229,5 +229,20 @@ QString Order( int order ) > } > > -bool GetInfo_XServer_Generic( QListView *lBox ) > +static QString BitString( unsigned long n ) > +{ > + return i18n("1 Bit", "%n Bits", n); // singular & plural form of "%d Bit" > +} > + > +static QString ByteString( unsigned long n ) > +{ > + /* explanation in BR #52640 (http://bugs.kde.org/show_bug.cgi?id=52640) */ > + if (n == 1) > + return i18n("1 Byte"); // singular form: "1 Byte" (yes, it's "1", not "%1"!) > + > + return i18n("%1 Bytes") // plural form: "%1 Bytes" > + .arg(KGlobal::locale()->formatNumber(n,0)); > +} > + > +static bool GetInfo_XServer_Generic( QListView *lBox ) > { > /* Many parts of this source are taken from the X11-program "xdpyinfo" */ > @@ -290,8 +305,10 @@ bool GetInfo_XServer_Generic( QListView > last->setExpandable(true); > for (i=0; i<n; i++) { > - item = new QListViewItem(last, item, i18n("Pixmap Format #%1").arg(i+1), > - i18n("%1 BPP, Depth: %2 Bit, scanline_pad: %3"). > - arg(pmf[i].bits_per_pixel).arg(pmf[i].depth). > - arg(pmf[i].scanline_pad)); > + item = new QListViewItem(last, item, > + i18n("Pixmap Format #%1").arg(i+1), > + i18n("%1 BPP, Depth: %2, Scanline padding: %3") > + .arg(pmf[i].bits_per_pixel) > + .arg(BitString(pmf[i].depth)) > + .arg(BitString(pmf[i].scanline_pad))); > } > XFree ((char *)pmf); > @@ -301,7 +318,7 @@ bool GetInfo_XServer_Generic( QListView > if (!req_size) req_size = XMaxRequestSize(dpy); > last = new QListViewItem(next, last, i18n("Maximum Request Size"), > - i18n("%1 Byte").arg(KGlobal::locale()->formatNumber(req_size*4,0))); > + ByteString(req_size*4)); > last = new QListViewItem(next, last, i18n("Motion Buffer Size"), > - i18n("%1 Byte").arg(KGlobal::locale()->formatNumber(XDisplayMotionBufferSize(dpy), 0))); > + ByteString(XDisplayMotionBufferSize(dpy))); > > last = item = new QListViewItem(next, last, i18n("Bitmap")); > > >
Hi Alexander, > Why not using standard plural forms (like in BitString) in ByteString? If in i18n(a,b,c), c needs to be an integer, then arg(KGlobal::locale()->formatNumber(n,0)) won't work (it's a string). You may test a patch and come up with a solution though, if it works for you.
Ok, I understand now. But why is it necessary to use formatNumber here? (while not using it anywhere in KDE when dealing with numbers of bytes) (In reply to comment #8) > Hi Alexander, > > > Why not using standard plural forms (like in BitString) in ByteString? > > If in i18n(a,b,c), c needs to be an integer, then > arg(KGlobal::locale()->formatNumber(n,0)) won't work (it's a string). > You may test a patch and come up with a solution though, if it works for you.
This decision to have 2 cases for singular and plural is really strange. How is that supposed to work with languages that have more than 2 plural forms?
Git commit 919d62e5119146c27bbf223a6d88cfe91e540923 by Chusslove Illich (Часлав Илић). Committed on 26/08/2012 at 11:24. Pushed by ilic into branch 'master'. i18n functions automatically locale-format numbers. M +3 -7 kinfocenter/Modules/base/os_base.h http://commits.kde.org/kde-workspace/919d62e5119146c27bbf223a6d88cfe91e540923