-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Ensure the progress dialog show how progress is measured #18341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Maintainers: This PR contains Strings changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels overly complex, I suspect it's much easier to understand with an optional formatProgressAmount
method
// Using Long in case a collection is more than 4gb | ||
data class Amount( | ||
/** | ||
* Represents the current progress. It's expected to evolve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what this means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the second sentence.
When I created it, I expected that the amount
value would be set only once, and only the current
property would be changed.
I realized later that actually, given the way the code is written, this would be complex to make this change, and totally useless.
<string name="byte_progress" comment="Indicates to the user how many bytes have been processed out of a known amount of bytes Consider keeping the unbreakable space after the number.">%1$d/%2$d bytes</string> | ||
<string name="kilobyte_progress" comment="Indicates to the user how many bytes have been processed out of a known amount of kilobytes Consider keeping the unbreakable space after the number.">%1$d/%2$d kB</string> | ||
<string name="megabyte_progress" comment="Indicates to the user how many bytes have been processed out of a known amount of megabytes Consider keeping the unbreakable space after the number.">%1$d/%2$d MB</string> | ||
<string name="gigabyte_progress" comment="Indicates to the user how many bytes have been processed out of a known amount of gigabytes Consider keeping the unbreakable space after the number.">%1$d/%2$d GB</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I didn't know about it.
However, I admit it's not clear to me it's actually better as it leads to sentences such as 512 kB/ 3MB.
I like the fact that, in my implementation, both numbers would be in the same unit, and the unit would not be repeated.
As a matter of styleguide, I recall it was recommender that a number using digits should be on the same line as the thing being counted. I found in Ankidroid a line ending with numbers While creating ankidroid#18341 I found that we may end up with lines ending with numbers. I don't know whether this rule is universal, so I only add a comment requesting translators to consider this. Still, I believe it's useful to indicate that this is an option as translators may not know it.
I admit I don't understand what |
86b236d
to
219c20e
Compare
As a matter of styleguide, I recall it was recommender that a number using digits should be on the same line as the thing being counted. I found in Ankidroid a line ending with numbers While creating ankidroid#18341 I found that we may end up with lines ending with numbers. I don't know whether this rule is universal, so I only add a comment requesting translators to consider this. Still, I believe it's useful to indicate that this is an option as translators may not know it.
As a matter of styleguide, I recall it was recommender that a number using digits should be on the same line as the thing being counted. I found in Ankidroid a line ending with numbers While creating #18341 I found that we may end up with lines ending with numbers. I don't know whether this rule is universal, so I only add a comment requesting translators to consider this. Still, I believe it's useful to indicate that this is an option as translators may not know it.
I did the change you requested. I’m not blocking on units. Anyway, I still believe it’s a net improvement over the current dialog |
I still feel this is too complex for formatting a string and would like a second opinion In particular, this feels like one rare place in the code where we want to avoid allocations nit: In addition: |
While doing a full sync, I found absurd to see the exact number of bytes of the collection. With 11 digits (100 mb), it was actually hard to even see how much progress was done, as it would require being able to count whether progress currently has 9, 10 or 11 digits. Using kb, mb makes it more readable. I don't expect that GB will currently be useful, but it's still worth adding to be future proof. I don't expect this extra translation will be painful. At the same time, I added the note that something is about a number of notes. I also added an option for scalar progress when no relevant type can suffixed to the number. This is the case in particular for database check, where we have a number of very distinct steps. In this case, I still let the translators translate "current/max" because I'm not certain this is universal way of showing progress
219c20e
to
5577dec
Compare
Sorry, but what do you mean by allocation? |
1/1 note is not relevant anymore. There was change in the code and it seems we are not counting note anymore. The only use was removed in 9eeef01 |
Memory allocations - I believe progress is a tight loop Still waiting for a second reviewer on this one. This still feels over-engineered to me, and I'm looking for someone to disagree |
While doing a full sync, I found absurd to see the exact number of bytes of the collection. With 11 digits (100 mb), it was actually hard to even see how much progress was done, as it would require being able to count whether progress currently has 9, 10 or 11 digits.
Using kb, mb makes it more readable. I don't expect that GB will currently be useful, but it's still worth adding to be future proof. I don't expect this extra translation will be painful.
At the same time, I added the note that something is about a number of notes.
I also added an option for scalar progress when no relevant type can suffixed to the number. This is the case in particular for database check, where we have a number of very distinct steps. In this case, I still let the translators translate "current/max" because I'm not certain this is universal way of showing progress