Convert scheduled-posts logout strings to <plurals>
This commit is contained in:
+16
-2
@@ -47,6 +47,7 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -64,6 +65,7 @@ import com.vitorpamplona.amethyst.service.scheduledposts.ScheduledPostStatus
|
||||
import com.vitorpamplona.amethyst.ui.components.CreateTextWithEmoji
|
||||
import com.vitorpamplona.amethyst.ui.components.RobohashFallbackAsyncImage
|
||||
import com.vitorpamplona.amethyst.ui.note.toShortDisplay
|
||||
import com.vitorpamplona.amethyst.ui.pluralStringRes
|
||||
import com.vitorpamplona.amethyst.ui.screen.AccountSessionManager
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedOff.AddAccountDialog
|
||||
@@ -289,7 +291,14 @@ private fun LogoutButton(
|
||||
title = { Text(text = stringRes(R.string.log_out)) },
|
||||
text = {
|
||||
if (unpublishedCount > 0) {
|
||||
Text(text = stringRes(R.string.scheduled_posts_logout_warning, unpublishedCount))
|
||||
Text(
|
||||
text =
|
||||
pluralStringResource(
|
||||
id = R.plurals.scheduled_posts_logout_warning,
|
||||
count = unpublishedCount,
|
||||
unpublishedCount,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
Text(text = stringRes(R.string.are_you_sure_you_want_to_log_out))
|
||||
}
|
||||
@@ -309,7 +318,12 @@ private fun LogoutButton(
|
||||
accountSessionManager.logOff(acc)
|
||||
val toastMessage =
|
||||
if (confirmedCount > 0) {
|
||||
stringRes(context, R.string.scheduled_posts_logout_toast, confirmedCount)
|
||||
pluralStringRes(
|
||||
context,
|
||||
R.plurals.scheduled_posts_logout_toast,
|
||||
confirmedCount,
|
||||
confirmedCount,
|
||||
)
|
||||
} else {
|
||||
stringRes(context, R.string.scheduled_posts_logout_toast_zero)
|
||||
}
|
||||
|
||||
@@ -421,7 +421,12 @@
|
||||
<string name="scheduled_posts_at_time_past">%1$s · před %2$s</string>
|
||||
<string name="scheduled_posts_day_tomorrow">Zítra</string>
|
||||
<string name="scheduled_posts_logout_toast_zero">Odhlášeno</string>
|
||||
<string name="scheduled_posts_logout_toast">Odhlášeno · smazáno %1$d naplánovaných příspěvků</string>
|
||||
<plurals name="scheduled_posts_logout_toast">
|
||||
<item quantity="one">Odhlášeno · smazán %d naplánovaný příspěvek</item>
|
||||
<item quantity="few">Odhlášeno · smazány %d naplánované příspěvky</item>
|
||||
<item quantity="many">Odhlášeno · smazáno %d naplánovaných příspěvků</item>
|
||||
<item quantity="other">Odhlášeno · smazáno %d naplánovaných příspěvků</item>
|
||||
</plurals>
|
||||
<string name="scheduled_posts_notification_sent_title">Naplánovaný příspěvek publikován</string>
|
||||
<string name="scheduled_posts_notification_failed_title">Naplánovaný příspěvek selhal</string>
|
||||
<string name="app_notification_scheduled_posts_channel_name">Naplánované příspěvky</string>
|
||||
@@ -435,7 +440,12 @@
|
||||
<string name="scheduled_posts_status_failed">Selhalo</string>
|
||||
<string name="scheduled_posts_status_sent">Odesláno</string>
|
||||
<string name="scheduled_posts_status_cancelled">Zrušeno</string>
|
||||
<string name="scheduled_posts_logout_warning">Máte %1$d naplánovaných příspěvků, které ještě nebyly publikovány. Odhlášením budou trvale smazány.</string>
|
||||
<plurals name="scheduled_posts_logout_warning">
|
||||
<item quantity="one">Máte %d naplánovaný příspěvek, který ještě nebyl publikován. Odhlášením bude trvale smazán.</item>
|
||||
<item quantity="few">Máte %d naplánované příspěvky, které ještě nebyly publikovány. Odhlášením budou trvale smazány.</item>
|
||||
<item quantity="many">Máte %d naplánovaných příspěvků, které ještě nebyly publikovány. Odhlášením budou trvale smazány.</item>
|
||||
<item quantity="other">Máte %d naplánovaných příspěvků, které ještě nebyly publikovány. Odhlášením budou trvale smazány.</item>
|
||||
</plurals>
|
||||
<plurals name="scheduled_posts_subtitle_queued">
|
||||
<item quantity="one">%d ve frontě</item>
|
||||
<item quantity="few">%d ve frontě</item>
|
||||
|
||||
@@ -426,7 +426,10 @@ anz der Bedingungen ist erforderlich</string>
|
||||
<string name="scheduled_posts_at_time_past">%1$s · vor %2$s</string>
|
||||
<string name="scheduled_posts_day_tomorrow">Morgen</string>
|
||||
<string name="scheduled_posts_logout_toast_zero">Abgemeldet</string>
|
||||
<string name="scheduled_posts_logout_toast">Abgemeldet · %1$d geplante(n) Beitrag/Beiträge gelöscht</string>
|
||||
<plurals name="scheduled_posts_logout_toast">
|
||||
<item quantity="one">Abgemeldet · %d geplanter Beitrag gelöscht</item>
|
||||
<item quantity="other">Abgemeldet · %d geplante Beiträge gelöscht</item>
|
||||
</plurals>
|
||||
<string name="scheduled_posts_notification_sent_title">Geplanter Beitrag veröffentlicht</string>
|
||||
<string name="scheduled_posts_notification_failed_title">Geplanter Beitrag fehlgeschlagen</string>
|
||||
<string name="app_notification_scheduled_posts_channel_name">Geplante Beiträge</string>
|
||||
@@ -440,7 +443,10 @@ anz der Bedingungen ist erforderlich</string>
|
||||
<string name="scheduled_posts_status_failed">Fehlgeschlagen</string>
|
||||
<string name="scheduled_posts_status_sent">Gesendet</string>
|
||||
<string name="scheduled_posts_status_cancelled">Abgebrochen</string>
|
||||
<string name="scheduled_posts_logout_warning">Du hast %1$d geplante(n) Beitrag/Beiträge, der/die noch nicht veröffentlicht wurden. Beim Abmelden werden sie dauerhaft gelöscht.</string>
|
||||
<plurals name="scheduled_posts_logout_warning">
|
||||
<item quantity="one">Du hast %d geplanten Beitrag, der noch nicht veröffentlicht wurde. Beim Abmelden wird er dauerhaft gelöscht.</item>
|
||||
<item quantity="other">Du hast %d geplante Beiträge, die noch nicht veröffentlicht wurden. Beim Abmelden werden sie dauerhaft gelöscht.</item>
|
||||
</plurals>
|
||||
<plurals name="scheduled_posts_subtitle_queued">
|
||||
<item quantity="one">%d in Warteschlange</item>
|
||||
<item quantity="other">%d in Warteschlange</item>
|
||||
|
||||
@@ -421,7 +421,11 @@
|
||||
<string name="scheduled_posts_at_time_past">%1$s · há %2$s</string>
|
||||
<string name="scheduled_posts_day_tomorrow">Amanhã</string>
|
||||
<string name="scheduled_posts_logout_toast_zero">Desconectado</string>
|
||||
<string name="scheduled_posts_logout_toast">Desconectado · %1$d post(s) agendado(s) excluído(s)</string>
|
||||
<plurals name="scheduled_posts_logout_toast">
|
||||
<item quantity="one">Desconectado · %d post agendado excluído</item>
|
||||
<item quantity="many">Desconectado · %d posts agendados excluídos</item>
|
||||
<item quantity="other">Desconectado · %d posts agendados excluídos</item>
|
||||
</plurals>
|
||||
<string name="scheduled_posts_notification_sent_title">Post agendado publicado</string>
|
||||
<string name="scheduled_posts_notification_failed_title">Post agendado falhou</string>
|
||||
<string name="app_notification_scheduled_posts_channel_name">Posts agendados</string>
|
||||
@@ -435,7 +439,11 @@
|
||||
<string name="scheduled_posts_status_failed">Falhou</string>
|
||||
<string name="scheduled_posts_status_sent">Enviado</string>
|
||||
<string name="scheduled_posts_status_cancelled">Cancelado</string>
|
||||
<string name="scheduled_posts_logout_warning">Você tem %1$d post(s) agendado(s) que ainda não foram publicados. Sair excluirá esses posts permanentemente.</string>
|
||||
<plurals name="scheduled_posts_logout_warning">
|
||||
<item quantity="one">Você tem %d post agendado que ainda não foi publicado. Sair excluirá esse post permanentemente.</item>
|
||||
<item quantity="many">Você tem %d posts agendados que ainda não foram publicados. Sair excluirá esses posts permanentemente.</item>
|
||||
<item quantity="other">Você tem %d posts agendados que ainda não foram publicados. Sair excluirá esses posts permanentemente.</item>
|
||||
</plurals>
|
||||
<plurals name="scheduled_posts_subtitle_queued">
|
||||
<item quantity="one">%d na fila</item>
|
||||
<item quantity="other">%d na fila</item>
|
||||
|
||||
@@ -421,7 +421,10 @@
|
||||
<string name="scheduled_posts_at_time_past">%1$s · för %2$s sedan</string>
|
||||
<string name="scheduled_posts_day_tomorrow">Imorgon</string>
|
||||
<string name="scheduled_posts_logout_toast_zero">Utloggad</string>
|
||||
<string name="scheduled_posts_logout_toast">Utloggad · %1$d schemalagda inlägg raderade</string>
|
||||
<plurals name="scheduled_posts_logout_toast">
|
||||
<item quantity="one">Utloggad · %d schemalagt inlägg raderat</item>
|
||||
<item quantity="other">Utloggad · %d schemalagda inlägg raderade</item>
|
||||
</plurals>
|
||||
<string name="scheduled_posts_notification_sent_title">Schemalagt inlägg publicerat</string>
|
||||
<string name="scheduled_posts_notification_failed_title">Schemalagt inlägg misslyckades</string>
|
||||
<string name="app_notification_scheduled_posts_channel_name">Schemalagda inlägg</string>
|
||||
@@ -435,7 +438,10 @@
|
||||
<string name="scheduled_posts_status_failed">Misslyckades</string>
|
||||
<string name="scheduled_posts_status_sent">Skickat</string>
|
||||
<string name="scheduled_posts_status_cancelled">Avbrutet</string>
|
||||
<string name="scheduled_posts_logout_warning">Du har %1$d schemalagda inlägg som inte har publicerats än. Att logga ut raderar dem permanent.</string>
|
||||
<plurals name="scheduled_posts_logout_warning">
|
||||
<item quantity="one">Du har %d schemalagt inlägg som inte har publicerats än. Att logga ut raderar det permanent.</item>
|
||||
<item quantity="other">Du har %d schemalagda inlägg som inte har publicerats än. Att logga ut raderar dem permanent.</item>
|
||||
</plurals>
|
||||
<plurals name="scheduled_posts_subtitle_queued">
|
||||
<item quantity="one">%d i kö</item>
|
||||
<item quantity="other">%d i kö</item>
|
||||
|
||||
@@ -453,7 +453,10 @@
|
||||
<string name="scheduled_posts_at_time_past">%1$s · %2$s ago</string>
|
||||
<string name="scheduled_posts_day_tomorrow">Tomorrow</string>
|
||||
<string name="scheduled_posts_logout_toast_zero">Logged out</string>
|
||||
<string name="scheduled_posts_logout_toast">Logged out · %1$d scheduled post(s) deleted</string>
|
||||
<plurals name="scheduled_posts_logout_toast">
|
||||
<item quantity="one">Logged out · %d scheduled post deleted</item>
|
||||
<item quantity="other">Logged out · %d scheduled posts deleted</item>
|
||||
</plurals>
|
||||
<string name="scheduled_posts_notification_sent_title">Scheduled post published</string>
|
||||
<string name="scheduled_posts_notification_failed_title">Scheduled post failed</string>
|
||||
<string name="app_notification_scheduled_posts_channel_id" translatable="false">ScheduledPostsID</string>
|
||||
@@ -468,7 +471,10 @@
|
||||
<string name="scheduled_posts_status_failed">Failed</string>
|
||||
<string name="scheduled_posts_status_sent">Sent</string>
|
||||
<string name="scheduled_posts_status_cancelled">Cancelled</string>
|
||||
<string name="scheduled_posts_logout_warning">You have %1$d scheduled post(s) that haven\'t been published yet. Logging out will permanently delete them.</string>
|
||||
<plurals name="scheduled_posts_logout_warning">
|
||||
<item quantity="one">You have %d scheduled post that hasn\'t been published yet. Logging out will permanently delete it.</item>
|
||||
<item quantity="other">You have %d scheduled posts that haven\'t been published yet. Logging out will permanently delete them.</item>
|
||||
</plurals>
|
||||
<plurals name="scheduled_posts_subtitle_queued">
|
||||
<item quantity="one">%d queued</item>
|
||||
<item quantity="other">%d queued</item>
|
||||
|
||||
Reference in New Issue
Block a user