[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Two problems in KPlato
From:       Dag Andersen <danders () get2net ! dk>
Date:       2009-02-05 8:37:31
Message-ID: 200902050937.31359.danders () get2net ! dk
[Download RAW message or body]

On Søndag 01 februar 2009 17:05:02 Albert Astals Cid wrote:
> A Diumenge, 1 de febrer de 2009, Yukiko Bando va escriure:
> > Hello,
> >
> > There are two strings that are not displayed properly in KPlato's Work &
> > Vacation editor on my system (KDE 4.2.0 + KOffice 1.9.98.5).
> >
> > 1. kplatomodels.po
> > #: kptcalendarmodel.cpp:771 kptcalendarmodel.cpp:903
> > #, kde-format
> > msgctxt "1=time 2=The number of hours of work duration"
> > msgid "%1, %2 hour"
> > msgid_plural "%1, %2 hours"
> >
> > This string is displayed in tooltip for working days of the week, but
> > always with an error message and "hours" as unit. For exmaple:
> >
> > 10:00, 1 hours(I18N_PLURAL_ARGUMENT_MISSING)
> > 09:00, 7 hours(I18N_PLURAL_ARGUMENT_MISSING)
>
> Dag, this is for you, you are using
>
> i18ncp( "1=time 2=The number of hours of work duration",
>         "%1, %2 hour",
>         "%1, %2 hours",
>         l->formatTime( i->startTime() ),
>         l->formatNumber( i->hours() ) );
>
> But this is wrong, i18ncp needs an integer argument to know which plural
> form to call and there both arguments are strings. Changing
> l->formatNumber( i-
>
> >hours() ) to i->hours() won't help either because it's a double, not sure
> > if
>
> you want to have 3.5 hours there or not, if you are ok with integer hours
> consider using qRound( i->hours() ), else i think you have to go with i18nc
> and explain %2 is a non integer number of hours.
Done, and yes it can be fractions of an hour so I changed it to i18nc.
-- 
Mvh.
Dag Andersen

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; \
font-weight:400; font-style:normal;">On Søndag 01 februar 2009 17:05:02 Albert Astals \
Cid wrote:<br> &gt; A Diumenge, 1 de febrer de 2009, Yukiko Bando va escriure:<br>
&gt; &gt; Hello,<br>
&gt; &gt;<br>
&gt; &gt; There are two strings that are not displayed properly in KPlato's Work \
&amp;<br> &gt; &gt; Vacation editor on my system (KDE 4.2.0 + KOffice 1.9.98.5).<br>
&gt; &gt;<br>
&gt; &gt; 1. kplatomodels.po<br>
&gt; &gt; #: kptcalendarmodel.cpp:771 kptcalendarmodel.cpp:903<br>
&gt; &gt; #, kde-format<br>
&gt; &gt; msgctxt "1=time 2=The number of hours of work duration"<br>
&gt; &gt; msgid "%1, %2 hour"<br>
&gt; &gt; msgid_plural "%1, %2 hours"<br>
&gt; &gt;<br>
&gt; &gt; This string is displayed in tooltip for working days of the week, but<br>
&gt; &gt; always with an error message and "hours" as unit. For exmaple:<br>
&gt; &gt;<br>
&gt; &gt; 10:00, 1 hours(I18N_PLURAL_ARGUMENT_MISSING)<br>
&gt; &gt; 09:00, 7 hours(I18N_PLURAL_ARGUMENT_MISSING)<br>
&gt;<br>
&gt; Dag, this is for you, you are using<br>
&gt;<br>
&gt; i18ncp( "1=time 2=The number of hours of work duration",<br>
&gt;         "%1, %2 hour",<br>
&gt;         "%1, %2 hours",<br>
&gt;         l-&gt;formatTime( i-&gt;startTime() ),<br>
&gt;         l-&gt;formatNumber( i-&gt;hours() ) );<br>
&gt;<br>
&gt; But this is wrong, i18ncp needs an integer argument to know which plural<br>
&gt; form to call and there both arguments are strings. Changing<br>
&gt; l-&gt;formatNumber( i-<br>
&gt;<br>
&gt; &gt;hours() ) to i-&gt;hours() won't help either because it's a double, not \
sure<br> &gt; &gt; if<br>
&gt;<br>
&gt; you want to have 3.5 hours there or not, if you are ok with integer hours<br>
&gt; consider using qRound( i-&gt;hours() ), else i think you have to go with \
i18nc<br> &gt; and explain %2 is a non integer number of hours.<br>
Done, and yes it can be fractions of an hour so I changed it to i18nc.<br>
-- <br>
Mvh.<br>
Dag Andersen</p></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic