From 6a3ab5422608935c68dd64137b381ead91ba9790 Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Tue, 15 Sep 2026 01:34:04 +0800 Subject: [PATCH] fix(map): '1 QSO' singular never matched on zh systems Android plurals have no 'one' category in Chinese (zh plural rules only contain 'other'), so a single QSO rendered as '1 QSOs' on Chinese-locale devices. Replace the plurals resource with explicit singular/plural strings selected in code. --- core/presentation/src/main/res/values-zh/strings.xml | 6 ++---- core/presentation/src/main/res/values/strings.xml | 6 ++---- .../java/com/rtbishop/look4sat/feature/map/MapScreen.kt | 6 ++++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/presentation/src/main/res/values-zh/strings.xml b/core/presentation/src/main/res/values-zh/strings.xml index a9293462..13636955 100644 --- a/core/presentation/src/main/res/values-zh/strings.xml +++ b/core/presentation/src/main/res/values-zh/strings.xml @@ -122,10 +122,8 @@ 能见度:%s %d 个呼号 · %d 次通联 - - %d QSO - %d QSOs - + %d QSO + %d QSOs 首通 卫星未知 日照中 diff --git a/core/presentation/src/main/res/values/strings.xml b/core/presentation/src/main/res/values/strings.xml index 52288200..ca1d2b20 100644 --- a/core/presentation/src/main/res/values/strings.xml +++ b/core/presentation/src/main/res/values/strings.xml @@ -147,10 +147,8 @@ Visibility: %s %d callsigns · %d QSOs - - %d QSO - %d QSOs - + %d QSO + %d QSOs First satellite unknown Visible diff --git a/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapScreen.kt b/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapScreen.kt index 12eb2864..5fec8c8e 100644 --- a/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapScreen.kt +++ b/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapScreen.kt @@ -62,7 +62,6 @@ import androidx.compose.ui.draw.rotate import androidx.compose.ui.draw.scale import androidx.compose.ui.graphics.Color as ComposeColor import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -446,7 +445,10 @@ private fun WorkedGridCallRow( modifier = Modifier.weight(1f) ) Text( - text = pluralStringResource(R.plurals.grid_qso_count, callQsos.size, callQsos.size), + // Plurals resources don't work for zh (only 'other' matches), so + // pick the singular/plural string explicitly. + text = if (callQsos.size == 1) stringResource(R.string.grid_qso_count_one, 1) + else stringResource(R.string.grid_qso_count_many, callQsos.size), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant, textAlign = androidx.compose.ui.text.style.TextAlign.Center,