[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Translating battery remaining time
From: "Ihar Hrachyshka" <ihar.hrachyshka () gmail ! com>
Date: 2008-11-26 22:01:02
Message-ID: fce2a370811261401m64919401g5e0f20afe3db8a86 () mail ! gmail ! com
[Download RAW message or body]
Maybe "%1 and %2 remaining" where %1 = # of hours, %2 = # of minutes
would be better, so that a translator can translate it like this:
"zastałosia %1 i %2"
or like this:
"zastałosia %2 i %1"
On Wed, Nov 26, 2008 at 11:57 PM, Albert Astals Cid <aacid@kde.org> wrote:
> A Dimecres 26 Novembre 2008, Ihar Hrachyshka va escriure:
>> I can't say for every language, but for mine it the best solution for
>> the problem. Of course, the concatenation itself should be also
>> translatable in case there are some languages where
>> seconds-minutes-hours have different places than in English (or f.e.
>> Belarusian).
>
> So the text would be "%1 remaining" where %1 is the time, 1 hour and 1 minute,
> 2 minutes, 3 hours.
>
> Is that acceptable?
>
> Albert
>
>>
>> On Wed, Nov 26, 2008 at 1:35 AM, Albert Astals Cid <aacid@kde.org> wrote:
>> > For translating battery time we have a code that looks like
>> >
>> > if (hours == 1 && minutes > 0) {
>> > // less than one hour and one minute
>> > minutes = qRound(m_remainingMSecs/60000) % 60;
>> > i18np("<b>1 hour 1 minute</b> remaining<br />",
>> > "<b>1 hour %1 minutes</b> remaining<br />", minutes);
>> > } else if (hours > 1) {
>> > minutes = qRound(m_remainingMSecs/60000) % 60;
>> > // at least two hours
>> > if (minutes > 0) {
>> > if (minutes == 1) {
>> > i18np("<b>%1 hour %1 minute</b> remaining<br />",
>> > "<b>%1 hours %2 minute</b> remaining<br />", hours, minutes));
>> > } else {
>> > i18np("<b>%1 hour %2 minutes</b> remaining<br />",
>> > "<b>%1 hours %2 minutes</b> remaining<br />", hours,
>> > minutes)); }
>> > } else {
>> > i18n("<b>%1 hours</b> remaining<br />", hours);
>> > }
>> > } else {
>> > // less than one hour
>> > i18np("<b>%1 minute</b> remaining<br />",
>> > "<b>%1 minutes</b> remaining<br />", minutes));
>> > }
>> >
>> > As discovered by Ihar this does not work well on complex languages where
>> > there are more than two plurals.
>> >
>> > The only solution i see is doing what KLocale::prettyFormatDuration does
>> > that is, translating hours, minutes, etc separately and then
>> > concatenating them with %1 %2
>> >
>> > Do you agree to that change?
>> >
>> > Albert
>
>
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic