Skip to content

Commit

Permalink
Subtituted 'Session' into 'Quit Session' text on go-back modal
Browse files Browse the repository at this point in the history
  • Loading branch information
AL-Session authored and fanchao committed Sep 5, 2024
1 parent 67bcc93 commit 786485d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
),
Expand Down

0 comments on commit 786485d

Please sign in to comment.