-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Last connected Dex status page English only #3303
Conversation
I don't care as much about when the battery was last checked or the number of days on the sensor. |
It's not just the time it takes to look for translations. It could lead to mistakes also. |
Merge remote-tracking branch 'Navid200/Navid_2024_01_20' into schubi
unit = "day"; | ||
t = t / 24; | ||
if (t != 1) unit = "days"; | ||
if (t > 28) { |
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.
why t > 28?! should it be t > 7
Please check if this is an error
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.
Even though it may look like I am adding this code, I am not.
I have copied an existing code, removed translation strings from it, and replaced them with English text.
Your questions should be posed with respect to the original existing code here:
xDrip/app/src/main/java/com/eveningoutpost/dexdrip/models/JoH.java
Lines 783 to 809 in 8da5e5d
public static String niceTimeScalar(double t, int digits) { | |
String unit = xdrip.getAppContext().getString(R.string.unit_second); | |
t = t / 1000; | |
if (t != 1) unit = xdrip.getAppContext().getString(R.string.unit_seconds); | |
if (t > 59) { | |
unit = xdrip.getAppContext().getString(R.string.unit_minute); | |
t = t / 60; | |
if (t != 1) unit = xdrip.getAppContext().getString(R.string.unit_minutes); | |
if (t > 59) { | |
unit = xdrip.getAppContext().getString(R.string.unit_hour); | |
t = t / 60; | |
if (t != 1) unit = xdrip.getAppContext().getString(R.string.unit_hours); | |
if (t > 24) { | |
unit = xdrip.getAppContext().getString(R.string.unit_day); | |
t = t / 24; | |
if (t != 1) unit = xdrip.getAppContext().getString(R.string.unit_days); | |
if (t > 28) { | |
unit = xdrip.getAppContext().getString(R.string.unit_week); | |
t = t / 7; | |
if (t != 1) unit = xdrip.getAppContext().getString(R.string.unit_weeks); | |
} | |
} | |
} | |
} | |
//if (t != 1) unit = unit + "s"; //implemented plurality in every step, because in other languages plurality of time is not every time adding the same character | |
return qs( t, digits) + " " + unit; | |
} |
If your questions and suggestions are accepted, the original code as well as my copy can be modified.
If your suggestions are not accepted for the original code, I don't see why they would only apply to my copy.
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 just saw pull request and made code review. That is all :)
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.
Thanks
The lead developer will see your review and my response to it. Hopefully he can make a decision.
Thanks to your comment, I realized that I needed to clarify that I am just copying an existing code and am not creating code from scratch. So, I appreciate your review.
Just an idea to optimize the code:
|
@jamorham The translation work that translated time units is here: 32a9cba I didn't want to undo it because it is used everywhere. I don't want to change the time units to English everywhere. I only want to do that on the status page. If you want me to do this differently, please tell me. But, parameterizing this will be a lot of work. is it necessary? I will do it if that is the only way. |
@jamorham This takes time: I would like to help people. But, this is not helping me. |
@jamorham The issue this PR will address is really slowing me down as a customer support staff. Would you please have a look? |
If this is unacceptable, which would be a shame because I then wish to know how come we don't translate the logs. I think we don't because you would like to be able to see the logs in English. For the same reason, I need to be able to see the value of last connected in English. If you accept the intent, but don't like how I have done it, please tell me what you don't like. If you don't like the intent, can I change the color of the text if it is 5 minutes or greater? But, this will eventually become a mess if one reading a minute some time in the future becomes the norm. |
Please lets have this in English only the same as everything else on the same page as well as all the logs, so that the support staff can do their job without having to constantly look for a translator.