translations: German and Spanish fixes, the Home status card reads from strings.xml, and Settings links to Weblate

This commit is contained in:
Seb3thehacker committed 2026-10-26 21:46:47 -07:00
1 parent 5df2dace77
commit 0627a32df7
5 files changed
+110 -57

No files matched your search

@@ -13,6 +13,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.automirrored.filled.Send
import androidx.compose.material.icons.filled.Build
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
@@ -46,6 +47,7 @@ internal object GearslipLinks {
const val MATRIX = "https://matrix.to/#/!mf0_mgBd5KqKpc9FfX_wHp1jFCcwAtPrndIn_oGIyMk?via=matrix.org"
const val SOURCE = "https://github.com/twinksoftware/gearslip"
const val CARS = "$SOURCE/blob/main/CARS.md"
const val TRANSLATE = "https://hosted.weblate.org/engage/gearslip/"
/** This version's release notes on GitHub; every release is tagged v plus its version name. */
val RELEASE_NOTES = "$SOURCE/releases/tag/v${app.seb3thehacker.gearslip.BuildConfig.VERSION_NAME}"
@@ -158,7 +160,7 @@ internal fun MoneroDialog(onDismiss: () -> Unit) {
)
}
/** The About section's links: the chat room, the source code, and credits. */
/** The About section's links: the chat room, translations, the source code, and credits. */
@Composable
internal fun AboutLinkRows() {
val context = LocalContext.current
@@ -177,6 +179,14 @@ internal fun AboutLinkRows() {
trailing = arrow,
)
SettingsDivider()
SettingsRow(
stringResource(R.string.about_translate),
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.TRANSLATE) },
subtitle = stringResource(R.string.about_translate_sub),
icon = Icons.Filled.Edit,
trailing = arrow,
)
SettingsDivider()
SettingsRow(
stringResource(R.string.about_source),
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.SOURCE) },
@@ -278,9 +278,23 @@ private fun StatusCard(status: SessionStatus.Snapshot) {
) {}
}
Column {
Text(status.headline, style = MaterialTheme.typography.headlineSmall, fontWeight = FontWeight.SemiBold)
// The steady states read from strings.xml; a stage or a failure comes with its own text.
val headline = when (status.phase) {
SessionStatus.Phase.IDLE -> stringResource(R.string.status_idle)
SessionStatus.Phase.CONNECTING -> stringResource(R.string.status_connecting)
SessionStatus.Phase.PROJECTING -> stringResource(R.string.status_projecting)
SessionStatus.Phase.DISCONNECTED -> stringResource(R.string.status_disconnected)
SessionStatus.Phase.FAILED -> status.headline
}
val detail = when (status.phase) {
SessionStatus.Phase.IDLE -> stringResource(R.string.status_idle_detail)
SessionStatus.Phase.PROJECTING -> stringResource(R.string.status_projecting_detail)
SessionStatus.Phase.DISCONNECTED -> stringResource(R.string.status_disconnected_detail)
else -> status.detail
}
Text(headline, style = MaterialTheme.typography.headlineSmall, fontWeight = FontWeight.SemiBold)
Spacer(Modifier.height(4.dp))
Text(status.detail, style = MaterialTheme.typography.bodyMedium)
Text(detail, style = MaterialTheme.typography.bodyMedium)
}
}
// The other way in: wireless, right under the cable's instructions.