diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/OnboardingBackPressAlertDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/OnboardingBackPressAlertDialog.kt index 4481f524d8..2852743df0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/OnboardingBackPressAlertDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/OnboardingBackPressAlertDialog.kt @@ -6,10 +6,12 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import com.squareup.phrase.Phrase import network.loki.messenger.R +import org.session.libsession.utilities.NonTranslatableStringConstants.APP_NAME import org.session.libsession.utilities.StringSubstitutionConstants.APP_NAME_KEY import org.thoughtcrime.securesms.ui.AlertDialog import org.thoughtcrime.securesms.ui.DialogButtonModel import org.thoughtcrime.securesms.ui.GetString +import org.thoughtcrime.securesms.ui.getSubbedString import org.thoughtcrime.securesms.ui.theme.LocalColors @Composable @@ -18,16 +20,18 @@ fun OnboardingBackPressAlertDialog( @StringRes textId: Int = R.string.onboardingBackAccountCreation, quit: () -> Unit ) { + val c = LocalContext.current + val quitButtonText = c.getSubbedString(R.string.quit, APP_NAME_KEY to APP_NAME) + AlertDialog( onDismissRequest = dismissDialog, title = stringResource(R.string.warning), text = stringResource(textId).let { txt -> - val c = LocalContext.current Phrase.from(txt).put(APP_NAME_KEY, c.getString(R.string.app_name)).format().toString() }, buttons = listOf( DialogButtonModel( - GetString(stringResource(R.string.quit)), + text = GetString(quitButtonText), color = LocalColors.current.danger, onClick = quit ),