Opened 7 years ago
Closed 7 years ago
#13686 closed enhancement (fixed)
Web+: Use BDurationFormat to format time remaining in Downloads.
Reported by: | akshay | Owned by: | pulkomandy |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Applications/WebPositive | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Currently I am using BDurationFormat instead of BRelativeDateTimeFormat because it will give more precise duration left. For e.g in case the time remaining is '1hr 50 mins', BDurationFormat will result in '1 hr, 50 min' whereas BRelativeDateTimeFormat will result in 'in 1 hour'. In my opinion having a more precise time(for a download time) would be better. But for longer duration probably using BRelativeDateTime format would be better. Others can give a better idea on this.
Currently if say the system time is 11:05 A.M and time remaining for download is '1 hr 50mins' it shows the status as (Finish: 12:55 - Over 1 hours left).
With the changes it will show the status as (Time Left: 1 hours 50 minutes)
Translation for 'Time left' would have to be added in the catkeys files.
Attachments (4)
Change History (11)
by , 7 years ago
Attachment: | 0001-Web-Use-BDurationFormat-to-format-time-remaining-in-.patch added |
---|
comment:1 by , 7 years ago
patch: | 0 → 1 |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Thanks for explaining that. :)
ICU::RelativeDateTimeFormatter doesn't support wording it that way. it only supports ('in' 2 hours). Not sure if it can be done any way else using ICU.
Probably then the way it's implemented in tracker status window is the best for this. It also shows exact end date + approx duration and makes use of appropriate time formatters.
by , 7 years ago
Attachment: | 0001-Use-formatters-from-locale-kit-to-format-time-remain.patch added |
---|
comment:4 by , 7 years ago
The traslation would need to be added for the changes in the catkeys files.
follow-up: 6 comment:5 by , 7 years ago
Translations are not a problem, for Haiku sources this is largely automated at https://i18n.haiku-os.org/pootle/, which is automatically synced with Haiku sourcecode.
Patch looks ok, except I would use %date and %duration instead of %time and %finishtime to make it clearer what they are.
I will build and test it to check how it looks in the download window before merging.
comment:6 by , 7 years ago
Replying to pulkomandy:
Translations are not a problem, for Haiku sources this is largely automated at https://i18n.haiku-os.org/pootle/, which is automatically synced with Haiku sourcecode.
Which unfortunately has been broken for a while, see #13576. Just in case you wait for the changes to pop up on pootle...
by , 7 years ago
Attachment: | 0001-Use-formatters-from-locale-kit-to-format-time-remain.2.patch added |
---|
This should be avoided:
For example, in French, typography rules require a (non-breakable) space before the ":" character. Hence, the character should be part of the translated string:
In fact, even better, so the translators can see what they are dealing with, would be something like this:
This gives the translator full control on how the text should look. Maybe some languages doesn't use the same character for parentheses?
I would rename the variables, as buffer1 and buffer2 aren't very descriptive names (I know, it was already this way, but while we are changing that code, it's a good idea to update this).
I preferred the previous format of exact end date + approximate duration. For example, it sometimes happens that I download something at an airport or train station over the provided wi-fi. There, I need the exact end date so I know wether the download will finish before I have to board my train/plane. In other cases, something like "more than 2 hours left" would be great, but I don't know if we can get ICU to word it this way.