Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.
i18n(android): use locale-aware date pattern and zoom formatting
Jochen Kirstätterbc776626dc40
diff --git a/android/app/src/main/kotlin/app/nectarlink/android/ui/desk/DeskScreen.kt b/android/app/src/main/kotlin/app/nectarlink/android/ui/desk/DeskScreen.ktindex a97d566..8772519 100644--- a/android/app/src/main/kotlin/app/nectarlink/android/ui/desk/DeskScreen.kt+++ b/android/app/src/main/kotlin/app/nectarlink/android/ui/desk/DeskScreen.kt@@ -2,6 +2,7 @@package app.nectarlink.android.ui.deskimport android.app.Activity+import android.text.format.DateFormatimport android.view.WindowManagerimport androidx.compose.foundation.BorderStrokeimport androidx.compose.foundation.Image@@ -507,15 +508,19 @@ private fun DeskClockDisplay() {}}- val timeFormat = remember { SimpleDateFormat("HH:mm", Locale.getDefault()) }- val secFormat = remember { SimpleDateFormat(":ss", Locale.getDefault()) }- val dateFormat = remember { SimpleDateFormat("EEEE, MMMM d", Locale.getDefault()) }+ val locale = Locale.getDefault()+ val timeFormat = remember(locale) { SimpleDateFormat("HH:mm", locale) }+ val secFormat = remember(locale) { SimpleDateFormat(":ss", locale) }+ val dateFormat = remember(locale) {+ val pattern = DateFormat.getBestDateTimePattern(locale, "EEEEMMMMd")+ SimpleDateFormat(pattern, locale)+ }val minuteKey = nowMs / 60_000Lval secondKey = nowMs / 1_000L- val timeText = remember(minuteKey) { timeFormat.format(Date(minuteKey * 60_000L)) }- val dateText = remember(minuteKey) { dateFormat.format(Date(minuteKey * 60_000L)) }- val secText = remember(secondKey) { secFormat.format(Date(secondKey * 1_000L)) }+ val timeText = remember(minuteKey, locale) { timeFormat.format(Date(minuteKey * 60_000L)) }+ val dateText = remember(minuteKey, locale) { dateFormat.format(Date(minuteKey * 60_000L)) }+ val secText = remember(secondKey, locale) { secFormat.format(Date(secondKey * 1_000L)) }Row(verticalAlignment = Alignment.Bottom,diff --git a/android/app/src/main/kotlin/app/nectarlink/android/ui/webcam/WebcamScreen.kt b/android/app/src/main/kotlin/app/nectarlink/android/ui/webcam/WebcamScreen.ktindex f3475b3..1110823 100644--- a/android/app/src/main/kotlin/app/nectarlink/android/ui/webcam/WebcamScreen.kt+++ b/android/app/src/main/kotlin/app/nectarlink/android/ui/webcam/WebcamScreen.kt@@ -60,7 +60,6 @@ import app.nectarlink.android.Rimport app.nectarlink.android.core.Deviceimport app.nectarlink.android.ui.detachedimport app.nectarlink.android.webcam.WebcamService-import java.util.Locale@OptIn(ExperimentalLayoutApi::class)@Composable@@ -406,7 +405,7 @@ fun WebcamScreen(Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {val zoomLabel = stringResource(R.string.webcam_zoom_label,- String.format(Locale.US, "%.1f", session.zoomRatio).toFloat(),+ session.zoomRatio,)Text(zoomLabel,