mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-19 17:08:22 +00:00
Extract strings
This commit is contained in:
parent
9935b641e1
commit
1445d56d08
@ -59,7 +59,7 @@ class InviteFriendFragment : Fragment() {
|
|||||||
@Composable
|
@Composable
|
||||||
private fun InviteFriend() {
|
private fun InviteFriend() {
|
||||||
Column(modifier = Modifier.background(MaterialTheme.colors.primarySurface)) {
|
Column(modifier = Modifier.background(MaterialTheme.colors.primarySurface)) {
|
||||||
AppBar("Invite a Friend", onBack = { delegate.onDialogBackPressed() }, onClose = { delegate.onDialogClosePressed() })
|
AppBar(stringResource(R.string.invite_a_friend), onBack = { delegate.onDialogBackPressed() }, onClose = { delegate.onDialogClosePressed() })
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(horizontal = 24.dp),
|
modifier = Modifier.padding(horizontal = 24.dp),
|
||||||
verticalArrangement = spacedBy(10.dp)
|
verticalArrangement = spacedBy(10.dp)
|
||||||
@ -84,7 +84,7 @@ class InviteFriendFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
"Invite your friend to chat with you on Session by sharing your Account ID with them.",
|
stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
style = MaterialTheme.typography.small,
|
style = MaterialTheme.typography.small,
|
||||||
color = classicDarkColors[5],
|
color = classicDarkColors[5],
|
||||||
|
@ -62,10 +62,13 @@ class NewConversationHomeFragment : Fragment() {
|
|||||||
ItemButton(textId = R.string.dialog_join_community_title, icon = R.drawable.ic_globe) { delegate.onJoinCommunitySelected() }
|
ItemButton(textId = R.string.dialog_join_community_title, icon = R.drawable.ic_globe) { delegate.onJoinCommunitySelected() }
|
||||||
Divider(modifier = Modifier.padding(start = 80.dp))
|
Divider(modifier = Modifier.padding(start = 80.dp))
|
||||||
ItemButton(textId = R.string.activity_settings_invite_button_title, icon = R.drawable.ic_invite_friend) { delegate.onInviteFriend() }
|
ItemButton(textId = R.string.activity_settings_invite_button_title, icon = R.drawable.ic_invite_friend) { delegate.onInviteFriend() }
|
||||||
Column(modifier = Modifier.padding(horizontal = 32.dp).padding(top = 20.dp)) {
|
Column(
|
||||||
Text(text = "Your Account ID", style = MaterialTheme.typography.medium)
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 32.dp)
|
||||||
|
.padding(top = 20.dp)) {
|
||||||
|
Text(text = stringResource(R.string.accountIdYours), style = MaterialTheme.typography.medium)
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Text(text = "Friends can message you by scanning your QR code.", color = classicDarkColors[5], style = MaterialTheme.typography.small)
|
Text(text = stringResource(R.string.qrYoursDescription), color = classicDarkColors[5], style = MaterialTheme.typography.small)
|
||||||
Spacer(modifier = Modifier.height(20.dp))
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
QrImage(string = TextSecurePreferences.getLocalNumber(requireContext())!!, contentDescription = "Your session id")
|
QrImage(string = TextSecurePreferences.getLocalNumber(requireContext())!!, contentDescription = "Your session id")
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ class NewMessageViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun Exception.toMessage() = when (this) {
|
private fun Exception.toMessage() = when (this) {
|
||||||
is SnodeAPI.Error.Generic -> "We couldn’t recognize this ONS. Please check and try again."
|
is SnodeAPI.Error.Generic -> application.getString(R.string.onsErrorNotRecognized)
|
||||||
else -> localizedMessage ?: application.getString(R.string.fragment_enter_public_key_error_message)
|
else -> localizedMessage ?: application.getString(R.string.fragment_enter_public_key_error_message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import androidx.compose.material.MaterialTheme
|
|||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
@ -27,7 +28,6 @@ import org.thoughtcrime.securesms.ui.components.QrImage
|
|||||||
import org.thoughtcrime.securesms.ui.components.SessionTabRow
|
import org.thoughtcrime.securesms.ui.components.SessionTabRow
|
||||||
import org.thoughtcrime.securesms.ui.setComposeContent
|
import org.thoughtcrime.securesms.ui.setComposeContent
|
||||||
import org.thoughtcrime.securesms.ui.small
|
import org.thoughtcrime.securesms.ui.small
|
||||||
import org.thoughtcrime.securesms.util.ScanQRCodeWrapperFragmentDelegate
|
|
||||||
import org.thoughtcrime.securesms.util.start
|
import org.thoughtcrime.securesms.util.start
|
||||||
|
|
||||||
private val TITLES = listOf(R.string.view, R.string.scan)
|
private val TITLES = listOf(R.string.view, R.string.scan)
|
||||||
@ -79,7 +79,9 @@ fun Tabs(sessionId: String, onScan: (String) -> Unit) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun QrPage(string: String) {
|
fun QrPage(string: String) {
|
||||||
Column(modifier = Modifier.padding(horizontal = 32.dp).fillMaxSize()) {
|
Column(modifier = Modifier
|
||||||
|
.padding(horizontal = 32.dp)
|
||||||
|
.fillMaxSize()) {
|
||||||
QrImage(
|
QrImage(
|
||||||
string = string,
|
string = string,
|
||||||
contentDescription = "Your session id",
|
contentDescription = "Your session id",
|
||||||
@ -88,7 +90,7 @@ fun QrPage(string: String) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "This is your Account ID. Other users can scan it to start a conversation with you.",
|
text = stringResource(R.string.this_is_your_account_id_other_users_can_scan_it_to_start_a_conversation_with_you),
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
style = MaterialTheme.typography.small
|
style = MaterialTheme.typography.small
|
||||||
)
|
)
|
||||||
|
@ -13,11 +13,10 @@ fun Context.sendInvitation() {
|
|||||||
action = Intent.ACTION_SEND
|
action = Intent.ACTION_SEND
|
||||||
putExtra(
|
putExtra(
|
||||||
Intent.EXTRA_TEXT,
|
Intent.EXTRA_TEXT,
|
||||||
"""Hey, I've been using Session to chat with complete privacy and security. Come join me! My Account ID is
|
getString(
|
||||||
|
R.string.accountIdShare,
|
||||||
${TextSecurePreferences.getLocalNumber(this@sendInvitation)}
|
TextSecurePreferences.getLocalNumber(this@sendInvitation)
|
||||||
|
)
|
||||||
Download it at https://getsession.org/"""
|
|
||||||
)
|
)
|
||||||
type = "text/plain"
|
type = "text/plain"
|
||||||
}.let { Intent.createChooser(it, getString(R.string.activity_settings_invite_button_title)) }
|
}.let { Intent.createChooser(it, getString(R.string.activity_settings_invite_button_title)) }
|
||||||
|
@ -38,7 +38,7 @@ fun AppBar(title: String, onClose: () -> Unit = {}, onBack: (() -> Unit)? = null
|
|||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(64.dp)) {
|
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(64.dp)) {
|
||||||
IconButton(onClick = onClose) {
|
IconButton(onClick = onClose) {
|
||||||
Icon(painter = painterResource(id = R.drawable.ic_x), contentDescription = "back")
|
Icon(painter = painterResource(id = R.drawable.ic_x), contentDescription = "close")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1125,4 +1125,11 @@
|
|||||||
<string name="unknown">Unknown</string>
|
<string name="unknown">Unknown</string>
|
||||||
<string name="contacts">Contacts</string>
|
<string name="contacts">Contacts</string>
|
||||||
<string name="conversations">Conversations</string>
|
<string name="conversations">Conversations</string>
|
||||||
|
<string name="invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them">Invite your friend to chat with you on Session by sharing your Account ID with them.</string>
|
||||||
|
<string name="invite_a_friend">Invite a Friend</string>
|
||||||
|
<string name="accountIdYours">Your Account ID</string>
|
||||||
|
<string name="qrYoursDescription">Friends can message you by scanning your QR code.</string>
|
||||||
|
<string name="onsErrorNotRecognized">We couldn\'t recognize this ONS. Please check it and try again.</string>
|
||||||
|
<string name="this_is_your_account_id_other_users_can_scan_it_to_start_a_conversation_with_you">This is your Account ID. Other users can scan it to start a conversation with you.</string>
|
||||||
|
<string name="accountIdShare">Hey, I\'ve been using Session to chat with complete privacy and security. Come join me! My Account ID is \n\n%1$s\n\nDownload it at https://getsession.org/</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user