Skip to content

Conversation

@auouymous
Copy link
Member

There is a brief moment at the start of download were task speed is zero, and it displays "00:00". Should it instead show "?" or "??:??", the later looking more like a an unknown duration? If so, it would need to be translatable since some languages don't use "?" as question mark, such as ";" in Greek.

@tpikonen
Copy link
Contributor

tpikonen commented Sep 2, 2023

Maybe use a dash ('-') for unknown speed and duration, instead of 0?

@elelay
Copy link
Member

elelay commented Sep 2, 2023

you don't have to find a single notation for all languages: use _(...) to let people translate...
Something like that, (I think it needs the if else so that i18n tools pick the string to localize)?

if task.speed > 0:
   status_text  = _('%(status)s (%(progress).0f%%, %(rate)b/s, %(remaining)s)')
else:
   status_text = _('%(status)s (%(progress).0f%%, %(rate)s/s, ?s)')
status_message = status_text % {
                   'status': task.STATUS_MESSAGE[task.status],
                   'progress': task.progress * 100,
                   'rate': util.format_filesize(task.speed))
                   'remaining': util.format_time(round((task.total_size * (1 - task.progress)) / task.speed)) if task.speed > 0 else 0)
}

@auouymous
Copy link
Member Author

Maybe use a dash ('-') for unknown speed and duration, instead of 0?

Oh ya, I forgot about dash.

status_text = _('%(status)s (%(progress).0f%%, %(rate)b/s, %(remaining)s)')

Did you mean %(rate)s/s with an s instead of b?

status_text = _('%(status)s (%(progress).0f%%, %(rate)s/s, ?s)')

Is the ?s meant to just be ??

And do you think we should make these translatable or just use dash? It would allow the /s to be translated, except that format_filesize() doesn't use translatable strings for the size units. Should we also make those translatable?

@auouymous auouymous force-pushed the show-duration-in-progress-tab branch from bbb7833 to 801ecac Compare September 2, 2023 08:36
@elelay
Copy link
Member

elelay commented Sep 2, 2023

status_text = _('%(status)s (%(progress).0f%%, %(rate)b/s, %(remaining)s)')

Did you mean %(rate)s/s with an s instead of b?

no, b/s, my mistake

And do you think we should make these translatable or just use dash? It would allow the /s to be translated, except that format_filesize() doesn't use translatable strings for the size units. Should we also make those translatable?

yeah I think they should be translatable, also format_filesize(), having a look at various translations of https://en.wikipedia.org/wiki/Bit_rate. You could ask on the #518 discussion what makes sense to our translators.

And make the status message translatable.
@auouymous auouymous force-pushed the show-duration-in-progress-tab branch from 801ecac to 5925bc9 Compare September 21, 2023 09:58
@auouymous auouymous merged commit 2676881 into gpodder:master Sep 21, 2023
@auouymous auouymous deleted the show-duration-in-progress-tab branch September 21, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants