Open
Conversation
MM2-0 reviewed Jun 1, 2025
Comment on lines +70 to +81
| private fun formatRemainingTime(alarmTime: Long, currentTime: Long): String { | ||
| val diff = alarmTime - currentTime | ||
| val minutes = (diff / (1000 * 60)) % 60 | ||
| val hours = diff / (1000 * 60 * 60) | ||
| | ||
| return if (hours > 0) { | ||
| "in $hours hr${if (hours > 1) "s" else ""} $minutes min${if (minutes != 1L) "s" else ""}" | ||
| } else { | ||
| "in $minutes min${if (minutes != 1L) "s" else ""}" | ||
| } | ||
| } | ||
| |
Owner
There was a problem hiding this comment.
This isn't translatable. It will look out of place in languages that aren't English.
Author
There was a problem hiding this comment.
Ah, I see the challenge with translation here. Since DateUtils.getRelativeTimeSpanString doesn’t support formatting like “x hrs y mins,” and I’m not aware of any other built-in function that does, I’m not quite sure how to approach this. Please feel free to close the PR or share any ideas on how to address this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1310
Changed Alarm Text from
in x hourstoin x hrs y mins