Make string translatable

This commit is contained in:
MM20 2024-08-16 23:33:53 +02:00
parent cc9bff436a
commit 561f85fd32
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 13 additions and 10 deletions

View File

@ -404,32 +404,32 @@ private fun CalendarEvent.getSummary(context: Context): String {
val isToday = DateUtils.isToday(endTime)
if (isToday) {
if (allDay) {
return "Due today"
return context.getString(R.string.task_due_today)
}
return "Due ${
DateUtils.formatDateTime(
return context.getString(
R.string.task_due_date, DateUtils.formatDateTime(
context,
endTime,
DateUtils.FORMAT_SHOW_TIME
)
}"
)
}
if (allDay) {
return "Due ${
DateUtils.formatDateTime(
return context.getString(
R.string.task_due_date, DateUtils.formatDateTime(
context,
endTime,
DateUtils.FORMAT_SHOW_DATE
)
}"
)
}
return "Due ${
DateUtils.formatDateTime(
return context.getString(
R.string.task_due_time, DateUtils.formatDateTime(
context,
endTime,
DateUtils.FORMAT_SHOW_DATE or DateUtils.FORMAT_SHOW_TIME
)
}"
)
}
val isToday =

View File

@ -324,6 +324,9 @@
</plurals>
<!-- Calendar events that last the entire day -->
<string name="calendar_event_allday">all-day</string>
<string name="task_due_time">Due at %1$s</string>
<string name="task_due_date">Due on %1$s</string>
<string name="task_due_today">Due today</string>
<!-- Default title that is shown in the music widget if the app that is playing media did not publish a title -->
<string name="music_widget_default_title">%1$s is playing media</string>
<string name="music_widget_no_data">No media has been played yet</string>