make it translatable

and add a notice that you can't rent
This commit is contained in:
Minecon724 2024-08-08 14:22:16 +02:00
parent a5d93da6ef
commit c5a401c1e5
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
3 changed files with 40 additions and 9 deletions

View file

@ -2,7 +2,6 @@ package eu.m724.vastapp.activity.dashboard.screen
import androidx.activity.ComponentActivity
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ContextualFlowRow
import androidx.compose.foundation.layout.ExperimentalLayoutApi
@ -80,15 +79,19 @@ fun InstancesScreen(dashboardViewModel: DashboardViewModel) {
)
}
} else {
Box(
Column(
modifier = Modifier
.fillMaxWidth()
.height(100.dp),
contentAlignment = Alignment.Center
verticalArrangement = Arrangement.Bottom,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = stringResource(id = R.string.no_instances)
)
Text(
text = stringResource(id = R.string.rent_on_website)
)
}
}
}
@ -221,12 +224,34 @@ fun InstanceDeleteDialog(
AlertDialog(
onDismissRequest = { onClose() },
confirmButton = {
TextButton(onClick = { onConfirm() }) { Text("Confirm") }
TextButton(
onClick = { onConfirm() }
) {
Text("Confirm")
}
},
dismissButton = {
TextButton(onClick = { onClose() }) { Text("Dismiss") }
TextButton(
onClick = { onClose() }
) {
Text("Dismiss")
}
},
title = {
Text(
text = stringResource(
id = R.string.instance_confirm_delete
)
)
},
text = {
Text(
text = stringResource(
id = R.string.instance_confirm_delete_text,
instance.rentalId,
instance.getName()
)
)
},
title = { Text("Really delete instance?") },
text = { Text("Instance #${instance.rentalId} (${instance.getName()})") },
)
}

View file

@ -4,7 +4,7 @@
<string name="title_activity_login">Logowanie</string>
<string name="nav_dashboard">Kokpit</string>
<string name="nav_billing">Płatności</string>
<string name="nav_instances">Maszyny</string>
<string name="nav_instances">Instancje</string>
<string name="nav_help">Pomoc</string>
<string name="balance">Bilans</string>
<string name="greeting">Witaj %1$s!</string>
@ -27,7 +27,10 @@
<string name="termux_not_configured">Termux nie jest skonfigurowany pod działanie z innymi aplikacjami.</string>
<string name="termux_open_instructions">Otwórz instrukcje na github.com</string>
<string name="termux_error">Wystąpił błąd:</string>
<string name="no_instances">Nie wynajmujesz żadnych maszyn</string>
<string name="no_instances">Nie wynajmujesz żadnych instancji</string>
<string name="webview_todo">(kiedyś to będzie tutaj)</string>
<string name="termux_no_ssh">Brakuje klienta SSH na Termux</string>
<string name="rent_on_website">Jeszcze nie możesz wynajmować z tej aplikacji</string>
<string name="instance_confirm_delete">Potwierdź usunięcie</string>
<string name="instance_confirm_delete_text">Instancja #%1$d (%2$s)</string>
</resources>

View file

@ -31,4 +31,7 @@
<string name="webview_todo">(this will be a webview)</string>
<string name="no_instances">You are not renting any instances</string>
<string name="termux_no_ssh">Missing SSH client on Termux</string>
<string name="rent_on_website">You can\'t rent from this app yet</string>
<string name="instance_confirm_delete">Confirm deletion</string>
<string name="instance_confirm_delete_text">Instance #%1$d (%2$s)</string>
</resources>