1
Fork 0
mirror of https://github.com/Steffo99/twom.git synced 2024-11-21 23:54:26 +00:00

Cleanup related to strings

This commit is contained in:
Steffo 2024-02-05 02:27:32 +01:00
parent 40bfd858ee
commit 9f82008b20
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
26 changed files with 151 additions and 142 deletions

View file

@ -8,7 +8,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R
@Composable @Composable
@Preview(name = "Regular", widthDp = 40, heightDp = 40) @Preview(name = "Regular", widthDp = 40, heightDp = 40)
@ -28,7 +30,7 @@ fun AvatarEmpty(
modifier = Modifier modifier = Modifier
.align(Alignment.Center), .align(Alignment.Center),
color = MaterialTheme.colorScheme.onTertiary.copy(alpha = alpha), color = MaterialTheme.colorScheme.onTertiary.copy(alpha = alpha),
text = text ?: "?", text = text ?: stringResource(R.string.avatar_empty_placeholder),
) )
} }
} }

View file

@ -58,7 +58,7 @@ fun ConfigureRoomForm(
Column(modifier) { Column(modifier) {
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
val avatarContentDescription = stringResource(R.string.create_avatar_label) val avatarContentDescription = stringResource(R.string.configure_avatarpicker_label)
AvatarPickerWrapbox( AvatarPickerWrapbox(
modifier = Modifier modifier = Modifier
.size(60.dp) .size(60.dp)
@ -87,7 +87,7 @@ fun ConfigureRoomForm(
.fillMaxWidth(), .fillMaxWidth(),
singleLine = true, singleLine = true,
label = { label = {
Text(stringResource(R.string.create_name_label)) Text(stringResource(R.string.configure_namepicker_label))
}, },
value = name, value = name,
onValueChange = { name = it } onValueChange = { name = it }
@ -100,7 +100,7 @@ fun ConfigureRoomForm(
.height(180.dp) .height(180.dp)
.fillMaxWidth(), .fillMaxWidth(),
label = { label = {
Text(stringResource(R.string.create_description_label)) Text(stringResource(R.string.configure_descriptionpicker_label))
}, },
value = description, value = description,
onValueChange = { description = it } onValueChange = { description = it }
@ -127,7 +127,15 @@ fun ConfigureRoomForm(
activity.finish() activity.finish()
}, },
) { ) {
Text(stringResource(R.string.create_complete_text)) Text(
stringResource(
if (initialConfiguration != null) {
R.string.configure_submit_label_update
} else {
R.string.configure_submit_label_create
}
)
)
} }
} }
} }

View file

@ -23,9 +23,9 @@ fun ConfigureActivityTopBar(
title = { title = {
Text( Text(
text = if (initialName == null) { text = if (initialName == null) {
stringResource(R.string.create_title) stringResource(R.string.configure_title_create)
} else { } else {
stringResource(R.string.edit_title, initialName) stringResource(R.string.configure_title_edit, initialName)
} }
) )
} }

View file

@ -16,7 +16,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R import eu.steffo.twom.R
import eu.steffo.twom.errorhandling.components.ErrorText import eu.steffo.twom.errorhandling.components.ErrorText
@ -52,7 +52,7 @@ fun LoginForm(
} }
) )
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
Text(LocalContext.current.getString(R.string.login_text)) Text(stringResource(R.string.login_intro_text))
} }
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
TextField( TextField(
@ -61,13 +61,13 @@ fun LoginForm(
value = username, value = username,
onValueChange = { username = it }, onValueChange = { username = it },
label = { label = {
Text(LocalContext.current.getString(R.string.login_username_label)) Text(stringResource(R.string.login_username_label))
}, },
placeholder = { placeholder = {
Text(LocalContext.current.getString(R.string.login_username_placeholder)) Text(stringResource(R.string.login_username_placeholder))
}, },
supportingText = { supportingText = {
Text(LocalContext.current.getString(R.string.login_username_supporting)) Text(stringResource(R.string.login_username_supporting))
}, },
) )
} }
@ -77,13 +77,13 @@ fun LoginForm(
value = password, value = password,
onValueChange = { password = it }, onValueChange = { password = it },
label = { label = {
Text(LocalContext.current.getString(R.string.login_password_label)) Text(stringResource(R.string.login_password_label))
}, },
placeholder = { placeholder = {
Text(LocalContext.current.getString(R.string.login_password_placeholder)) Text(stringResource(R.string.login_password_placeholder))
}, },
supportingText = { supportingText = {
Text(LocalContext.current.getString(R.string.login_password_supporting)) Text(stringResource(R.string.login_password_supporting))
}, },
) )
} }
@ -98,7 +98,7 @@ fun LoginForm(
} }
}, },
) { ) {
Text(LocalContext.current.getString(R.string.login_complete_text)) Text(stringResource(R.string.login_submit_text))
} }
} }
manager.error.Display { manager.error.Display {

View file

@ -5,7 +5,7 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R import eu.steffo.twom.R
import eu.steffo.twom.navigation.components.BackIconButton import eu.steffo.twom.navigation.components.BackIconButton
@ -19,6 +19,6 @@ fun LoginActivityTopBar(
TopAppBar( TopAppBar(
modifier = modifier, modifier = modifier,
navigationIcon = { BackIconButton() }, navigationIcon = { BackIconButton() },
title = { Text(LocalContext.current.getString(R.string.login_title)) } title = { Text(stringResource(R.string.login_title)) }
) )
} }

View file

@ -12,7 +12,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
@ -55,10 +55,10 @@ fun PasswordField(
Icons.Outlined.RemoveRedEye Icons.Outlined.RemoveRedEye
}, },
if(showPassword) { if(showPassword) {
LocalContext.current.getString(R.string.password_hide) stringResource(R.string.password_hide)
} }
else { else {
LocalContext.current.getString(R.string.password_show) stringResource(R.string.password_show)
} }
) )
} }

View file

@ -16,7 +16,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R import eu.steffo.twom.R
@ -48,12 +47,12 @@ fun AccountIconButton(
if (session == null) { if (session == null) {
Icon( Icon(
imageVector = Icons.Filled.AccountCircle, imageVector = Icons.Filled.AccountCircle,
contentDescription = LocalContext.current.getString(R.string.main_account_label), contentDescription = stringResource(R.string.accountmenu_label),
) )
} else { } else {
AvatarUserId( AvatarUserId(
userId = session.myUserId, userId = session.myUserId,
contentDescription = LocalContext.current.getString(R.string.main_account_label), contentDescription = stringResource(R.string.accountmenu_label),
) )
} }
} }
@ -64,7 +63,7 @@ fun AccountIconButton(
if (session == null) { if (session == null) {
DropdownMenuItem( DropdownMenuItem(
text = { text = {
Text(stringResource(R.string.main_account_login_text)) Text(stringResource(R.string.accountmenu_login_label))
}, },
onClick = { onClick = {
expanded = false expanded = false
@ -74,7 +73,7 @@ fun AccountIconButton(
} else { } else {
DropdownMenuItem( DropdownMenuItem(
text = { text = {
Text(stringResource(R.string.main_account_logout_text)) Text(stringResource(R.string.accountmenu_logout_label))
}, },
onClick = { onClick = {
expanded = false expanded = false

View file

@ -125,10 +125,7 @@ fun CreateRoomFAB(
Log.i(TAG, "Creating room: ${createRoomParams.name}") Log.i(TAG, "Creating room: ${createRoomParams.name}")
val roomId = session.roomService().createRoom(createRoomParams) val roomId = session.roomService().createRoom(createRoomParams)
Log.d( Log.d(TAG, "Successfully created room: $roomId")
TAG,
"Successfully created room: ${createRoomParams.name}"
)
} }
} }
@ -142,7 +139,7 @@ fun CreateRoomFAB(
) )
}, },
text = { text = {
Text(stringResource(R.string.main_efab_create_text)) Text(stringResource(R.string.createroom_label))
} }
) )
} }

View file

@ -43,7 +43,7 @@ fun MainContentLoggedIn(
} else if (roomSummaries!!.isEmpty()) { } else if (roomSummaries!!.isEmpty()) {
Text( Text(
modifier = Modifier.basePadding(), modifier = Modifier.basePadding(),
text = stringResource(R.string.main_roomlist_empty_text) text = stringResource(R.string.main_empty_text)
) )
} else { } else {
roomSummaries!!.forEach { RoomListItem(it) } roomSummaries!!.forEach { RoomListItem(it) }

View file

@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.material3.Text import androidx.compose.material3.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.platform.LocalContext import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R import eu.steffo.twom.R
import eu.steffo.twom.theme.utils.basePadding import eu.steffo.twom.theme.utils.basePadding
@ -17,10 +17,10 @@ fun MainContentNotLoggedIn(
) { ) {
Column(modifier) { Column(modifier) {
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
Text(LocalContext.current.getString(R.string.main_notloggedin_text_1)) Text(stringResource(R.string.main_notloggedin_intro_1))
} }
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
Text(LocalContext.current.getString(R.string.main_notloggedin_text_2)) Text(stringResource(R.string.main_notloggedin_intro_2))
} }
} }
} }

View file

@ -136,9 +136,9 @@ fun RoomListItem(
Text( Text(
text = stringResource( text = stringResource(
id = if (count != 1) { id = if (count != 1) {
R.string.main_partecipants R.string.main_partecipantcount_text_plural
} else { } else {
R.string.main_partecipant R.string.main_partecipantcount_text_singular
}, },
count, count,
), ),

View file

@ -10,15 +10,15 @@ class TwoMRoomDisplayNameFallbackProvider(
) : RoomDisplayNameFallbackProvider { ) : RoomDisplayNameFallbackProvider {
override fun getNameFor1member(name: String): String { override fun getNameFor1member(name: String): String {
return context.getString(R.string.room_name_fallback_members_1).format(name) return context.getString(R.string.matrix_fallback_members_1).format(name)
} }
override fun getNameFor2members(name1: String, name2: String): String { override fun getNameFor2members(name1: String, name2: String): String {
return context.getString(R.string.room_name_fallback_members_2).format(name1, name2) return context.getString(R.string.matrix_fallback_members_2).format(name1, name2)
} }
override fun getNameFor3members(name1: String, name2: String, name3: String): String { override fun getNameFor3members(name1: String, name2: String, name3: String): String {
return context.getString(R.string.room_name_fallback_members_3).format(name1, name2, name3) return context.getString(R.string.matrix_fallback_members_3).format(name1, name2, name3)
} }
override fun getNameFor4members( override fun getNameFor4members(
@ -27,7 +27,8 @@ class TwoMRoomDisplayNameFallbackProvider(
name3: String, name3: String,
name4: String name4: String
): String { ): String {
return context.getString(R.string.room_name_fallback_members_4).format(name1, name2, name3, name4) return context.getString(R.string.matrix_fallback_members_4)
.format(name1, name2, name3, name4)
} }
override fun getNameFor4membersAndMore( override fun getNameFor4membersAndMore(
@ -36,14 +37,15 @@ class TwoMRoomDisplayNameFallbackProvider(
name3: String, name3: String,
remainingCount: Int remainingCount: Int
): String { ): String {
return context.getString(R.string.room_name_fallback_members_more).format(name1, name2, name3, remainingCount) return context.getString(R.string.matrix_fallback_members_more)
.format(name1, name2, name3, remainingCount)
} }
override fun getNameForEmptyRoom(isDirect: Boolean, leftMemberNames: List<String>): String { override fun getNameForEmptyRoom(isDirect: Boolean, leftMemberNames: List<String>): String {
return context.getString(R.string.room_name_fallback_members_0) return context.getString(R.string.matrix_fallback_members_0)
} }
override fun getNameForRoomInvite(): String { override fun getNameForRoomInvite(): String {
return context.getString(R.string.room_name_fallback_invite) return context.getString(R.string.matrix_fallback_invite)
} }
} }

View file

@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import eu.steffo.twom.R import eu.steffo.twom.R
import eu.steffo.twom.viewroom.effects.canIInvite import eu.steffo.twom.viewroom.effects.canCurrentSessionInviteHere
@Composable @Composable
@Preview @Preview
@ -18,7 +18,7 @@ fun InviteFAB(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
onClick: () -> Unit = {}, onClick: () -> Unit = {},
) { ) {
if (!canIInvite()) { if (!canCurrentSessionInviteHere()) {
return return
} }
@ -32,7 +32,7 @@ fun InviteFAB(
) )
}, },
text = { text = {
Text(stringResource(R.string.room_invite_button_label)) Text(stringResource(R.string.invite_submit_label))
} }
) )
} }

View file

@ -50,7 +50,7 @@ fun InviteSheet(
modifier = Modifier modifier = Modifier
.basePadding() .basePadding()
.fillMaxWidth(), .fillMaxWidth(),
text = stringResource(R.string.room_invite_title), text = stringResource(R.string.invite_title),
style = MaterialTheme.typography.headlineSmall, style = MaterialTheme.typography.headlineSmall,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
) )

View file

@ -44,7 +44,7 @@ fun InviteUserForm(
if (room == null) { if (room == null) {
ErrorText( ErrorText(
modifier = Modifier.basePadding(), modifier = Modifier.basePadding(),
text = stringResource(R.string.room_error_room_notfound) text = stringResource(R.string.invite_error_room_notfound)
) )
return return
} }
@ -58,12 +58,12 @@ fun InviteUserForm(
singleLine = true, singleLine = true,
label = { label = {
Text( Text(
text = stringResource(R.string.room_invite_username_label) text = stringResource(R.string.invite_username_label)
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.room_invite_username_placeholder) text = stringResource(R.string.invite_username_placeholder)
) )
}, },
) )
@ -88,7 +88,7 @@ fun InviteUserForm(
room.membershipService().invite(userId) room.membershipService().invite(userId)
} catch (e: Throwable) { } catch (e: Throwable) {
Log.e("Room", "Failed to send invite to `$userId`: $error") Log.e("Room", "Failed to send invite to `$userId`: $error")
error = LocalizableError(R.string.room_error_invite_generic, e) error = LocalizableError(R.string.invite_error_invite_generic, e)
busy = false busy = false
return@SendInvite return@SendInvite
} }
@ -101,7 +101,7 @@ fun InviteUserForm(
}, },
) { ) {
Text( Text(
text = stringResource(R.string.room_invite_button_label) text = stringResource(R.string.invite_submit_label)
) )
} }

View file

@ -28,7 +28,7 @@ import eu.steffo.twom.avatar.components.AvatarUser
import eu.steffo.twom.errorhandling.components.ErrorText import eu.steffo.twom.errorhandling.components.ErrorText
import eu.steffo.twom.matrix.complocals.LocalSession import eu.steffo.twom.matrix.complocals.LocalSession
import eu.steffo.twom.viewroom.complocals.LocalRoom import eu.steffo.twom.viewroom.complocals.LocalRoom
import eu.steffo.twom.viewroom.effects.canIKick import eu.steffo.twom.viewroom.effects.canCurrentSessionKickHere
import eu.steffo.twom.viewroom.effects.observeRSVP import eu.steffo.twom.viewroom.effects.observeRSVP
import eu.steffo.twom.viewroom.effects.resolveUser import eu.steffo.twom.viewroom.effects.resolveUser
import eu.steffo.twom.viewroom.utils.RSVPAnswer import eu.steffo.twom.viewroom.utils.RSVPAnswer
@ -61,14 +61,14 @@ fun MemberListItem(
val room = roomRequest.getOrNull() val room = roomRequest.getOrNull()
if (room == null) { if (room == null) {
ErrorText( ErrorText(
text = stringResource(R.string.room_error_room_notfound) text = stringResource(R.string.invite_error_room_notfound)
) )
return return
} }
// This might not be necessary; I'm not sure when the internal Matrix client resolves users // This might not be necessary; I'm not sure when the internal Matrix client resolves users
val user = resolveUser(member.userId) val user = resolveUser(member.userId)
val canKick = canIKick() val canKick = canCurrentSessionKickHere()
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()

View file

@ -33,7 +33,7 @@ fun RSVPChip(
}, },
label = { label = {
Text( Text(
text = representedAnswer.toLabel() ?: "[missing label]", text = representedAnswer.toLabel(),
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
) )
}, },

View file

@ -30,7 +30,7 @@ fun RSVPUpdateButton(
) )
) { ) {
Text( Text(
text = stringResource(R.string.room_rsvp_update_label) text = stringResource(R.string.room_update_label)
) )
} }
} }

View file

@ -70,7 +70,7 @@ fun RoomIconButton(
val room = roomRequest.getOrNull() val room = roomRequest.getOrNull()
if (room == null) { if (room == null) {
ErrorIconButton( ErrorIconButton(
message = stringResource(R.string.room_error_room_notfound) message = stringResource(R.string.invite_error_room_notfound)
) )
return return
} }

View file

@ -59,7 +59,7 @@ fun ViewRoomForm() {
if (room == null) { if (room == null) {
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
ErrorText( ErrorText(
text = stringResource(R.string.room_error_room_notfound) text = stringResource(R.string.invite_error_room_notfound)
) )
} }
return return

View file

@ -37,7 +37,7 @@ fun ViewRoomMembers() {
if (room == null) { if (room == null) {
Row(Modifier.basePadding()) { Row(Modifier.basePadding()) {
ErrorText( ErrorText(
text = stringResource(R.string.room_error_room_notfound) text = stringResource(R.string.invite_error_room_notfound)
) )
} }
return return

View file

@ -1,6 +1,5 @@
package eu.steffo.twom.viewroom.components package eu.steffo.twom.viewroom.components
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
@ -20,7 +19,7 @@ import eu.steffo.twom.viewroom.complocals.LocalRoomSummary
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import java.util.Optional import java.util.Optional
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @OptIn(ExperimentalMaterial3Api::class)
@Composable @Composable
fun ViewRoomScaffold( fun ViewRoomScaffold(
session: Session, session: Session,

View file

@ -6,7 +6,7 @@ import observePowerLevels
import kotlin.jvm.optionals.getOrNull import kotlin.jvm.optionals.getOrNull
@Composable @Composable
fun canIInvite(): Boolean { fun canCurrentSessionInviteHere(): Boolean {
val session = LocalSession.current ?: return false val session = LocalSession.current ?: return false
val powerLevelsRequest = observePowerLevels() ?: return false val powerLevelsRequest = observePowerLevels() ?: return false
val powerLevels = powerLevelsRequest.getOrNull() ?: return false val powerLevels = powerLevelsRequest.getOrNull() ?: return false

View file

@ -6,7 +6,7 @@ import observePowerLevels
import kotlin.jvm.optionals.getOrNull import kotlin.jvm.optionals.getOrNull
@Composable @Composable
fun canIKick(): Boolean { fun canCurrentSessionKickHere(): Boolean {
val session = LocalSession.current ?: return false val session = LocalSession.current ?: return false
val powerLevelsRequest = observePowerLevels() ?: return false val powerLevelsRequest = observePowerLevels() ?: return false
val powerLevels = powerLevelsRequest.getOrNull() ?: return false val powerLevels = powerLevelsRequest.getOrNull() ?: return false

View file

@ -34,15 +34,15 @@ enum class RSVPAnswer {
@Composable @Composable
override fun toLabel(): String = override fun toLabel(): String =
stringResource(R.string.room_rsvp_sure_label) stringResource(R.string.rsvp_sure_label)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_sure_response) stringResource(R.string.rsvp_sure_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_sure_placeholder) stringResource(R.string.rsvp_sure_placeholder)
}, },
// Will be there, but later! // Will be there, but later!
@ -58,15 +58,15 @@ enum class RSVPAnswer {
@Composable @Composable
override fun toLabel(): String = override fun toLabel(): String =
stringResource(R.string.room_rsvp_later_label) stringResource(R.string.rsvp_later_label)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_later_response) stringResource(R.string.rsvp_later_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_later_placeholder) stringResource(R.string.rsvp_later_placeholder)
}, },
// Might be there... // Might be there...
@ -82,15 +82,15 @@ enum class RSVPAnswer {
@Composable @Composable
override fun toLabel(): String = override fun toLabel(): String =
stringResource(R.string.room_rsvp_maybe_label) stringResource(R.string.rsvp_maybe_label)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_maybe_response) stringResource(R.string.rsvp_maybe_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_maybe_placeholder) stringResource(R.string.rsvp_maybe_placeholder)
}, },
// Won't be there. // Won't be there.
@ -106,15 +106,15 @@ enum class RSVPAnswer {
@Composable @Composable
override fun toLabel(): String = override fun toLabel(): String =
stringResource(R.string.room_rsvp_noway_label) stringResource(R.string.rsvp_noway_label)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_noway_response) stringResource(R.string.rsvp_noway_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_noway_placeholder) stringResource(R.string.rsvp_noway_placeholder)
}, },
// An option differing from the previous ones. // An option differing from the previous ones.
@ -129,16 +129,16 @@ enum class RSVPAnswer {
get() = Icons.Outlined.BuildCircle get() = Icons.Outlined.BuildCircle
@Composable @Composable
override fun toLabel(): String? = override fun toLabel(): String =
null stringResource(R.string.rsvp_nolabel)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_unknown_response) stringResource(R.string.rsvp_unknown_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_nullish_placeholder) stringResource(R.string.rsvp_nullish_placeholder)
}, },
// The answer is still being loaded. // The answer is still being loaded.
@ -153,7 +153,8 @@ enum class RSVPAnswer {
get() = Icons.Outlined.HourglassEmpty get() = Icons.Outlined.HourglassEmpty
@Composable @Composable
override fun toLabel(): String? = null override fun toLabel(): String =
stringResource(R.string.rsvp_nolabel)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
@ -161,7 +162,7 @@ enum class RSVPAnswer {
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_nullish_placeholder) stringResource(R.string.rsvp_nullish_placeholder)
}, },
// No answer has been provided yet. // No answer has been provided yet.
@ -176,16 +177,16 @@ enum class RSVPAnswer {
get() = Icons.Outlined.Circle get() = Icons.Outlined.Circle
@Composable @Composable
override fun toLabel(): String? = override fun toLabel(): String =
null stringResource(R.string.rsvp_nolabel)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_none_response) stringResource(R.string.rsvp_none_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_nullish_placeholder) stringResource(R.string.rsvp_nullish_placeholder)
}, },
// Has been invited, but has not accepted yet. // Has been invited, but has not accepted yet.
@ -200,16 +201,16 @@ enum class RSVPAnswer {
get() = Icons.Outlined.MoreHoriz get() = Icons.Outlined.MoreHoriz
@Composable @Composable
override fun toLabel(): String? = override fun toLabel(): String =
null stringResource(R.string.rsvp_nolabel)
@Composable @Composable
override fun toResponse(): String = override fun toResponse(): String =
stringResource(R.string.room_rsvp_pending_response) stringResource(R.string.rsvp_pending_response)
@Composable @Composable
override fun toCommentPlaceholder(): String = override fun toCommentPlaceholder(): String =
stringResource(R.string.room_rsvp_nullish_placeholder) stringResource(R.string.rsvp_nullish_placeholder)
}; };
abstract val value: String abstract val value: String
@ -217,7 +218,7 @@ enum class RSVPAnswer {
abstract val icon: ImageVector abstract val icon: ImageVector
@Composable @Composable
abstract fun toLabel(): String? abstract fun toLabel(): String
@Composable @Composable
abstract fun toResponse(): String abstract fun toResponse(): String

View file

@ -1,68 +1,66 @@
<resources> <resources>
<string name="app_name">TwoM</string> <string name="app_name" translatable="false">TwoM</string>
<string name="room_name_fallback_members_0">A brand new party</string> <string name="matrix_fallback_members_0">A brand new party</string>
<string name="room_name_fallback_members_1">Partying with %1$s</string> <string name="matrix_fallback_members_1">Partying with %1$s</string>
<string name="room_name_fallback_members_2">Partying with %1$s and %2$s</string> <string name="matrix_fallback_members_2">Partying with %1$s and %2$s</string>
<string name="room_name_fallback_members_3">Partying with %1$s, %2$s, and %3$s</string> <string name="matrix_fallback_members_3">Partying with %1$s, %2$s, and %3$s</string>
<string name="room_name_fallback_members_4">Partying with %1$s, %2$s, %3$s, and %4$s</string> <string name="matrix_fallback_members_4">Partying with %1$s, %2$s, %3$s, and %4$s</string>
<string name="room_name_fallback_members_more">Partying with %1$s, %2$s, %3$s and %4$d others</string> <string name="matrix_fallback_members_more">Partying with %1$s, %2$s, %3$s and %4$d others</string>
<string name="room_name_fallback_invite">Party invite</string> <string name="matrix_fallback_invite">Party invite</string>
<string name="login_title">Log into Matrix</string> <string name="login_title">Log into Matrix</string>
<string name="back">Go back</string> <string name="back">Go back</string>
<string name="login_text">To use TwoM, you need to log into a Matrix homeserver. Currently, TwoM supports only username and password authentication.</string> <string name="login_intro_text">To use TwoM, you need to log into a Matrix homeserver. Currently, TwoM supports only username and password authentication.</string>
<string name="login_complete_text">Log in</string> <string name="login_submit_text">Log in</string>
<string name="login_username_placeholder">\@steffo:candy.steffo.eu</string> <string name="login_username_placeholder" translatable="false">\@steffo:candy.steffo.eu</string>
<string name="login_username_supporting">The Matrix ID to login as, including the leading \"@\" and the trailing \":localpart\".</string> <string name="login_username_supporting">The Matrix ID to login as, including the leading \"@\" and the trailing \":localpart\".</string>
<string name="login_password_placeholder">p4ssw0rd!</string> <string name="login_password_placeholder" translatable="false">p4ssw0rd!</string>
<string name="login_password_supporting">The password of the Matrix account.</string> <string name="login_password_supporting">The password of the Matrix account.</string>
<string name="login_username_label">Username</string> <string name="login_username_label">Username</string>
<string name="login_password_label">Password</string> <string name="login_password_label">Password</string>
<string name="password_show">Show password</string> <string name="password_show">Show password</string>
<string name="password_hide">Hide password</string> <string name="password_hide">Hide password</string>
<string name="main_notloggedin_text_1">To use TwoM, you need to select the Matrix account to use.</string> <string name="main_notloggedin_intro_1">To use TwoM, you need to select the Matrix account to use.</string>
<string name="main_account_label">My account</string> <string name="accountmenu_label">My account</string>
<string name="main_account_logout_text">Logout</string> <string name="accountmenu_logout_label">Logout</string>
<string name="main_roomlist_empty_text">There are no rooms.</string> <string name="main_empty_text">There are no rooms.</string>
<string name="loading">Loading…</string> <string name="loading">Loading…</string>
<string name="main_efab_create_text">New</string> <string name="main_notloggedin_intro_2">Log into your Matrix account by clicking the icon on the top right of the screen.</string>
<string name="main_notloggedin_text_2">Log into your Matrix account by clicking the icon on the top right of the screen.</string> <string name="accountmenu_login_label">Login</string>
<string name="main_account_login_text">Login</string> <string name="configure_title_create">Create a new happening</string>
<string name="create_title">Create a new happening</string> <string name="configure_namepicker_label">Name</string>
<string name="create_name_label">Name</string> <string name="configure_avatarpicker_label">Select happening avatar</string>
<string name="create_avatar_label">Select happening avatar</string> <string name="configure_descriptionpicker_label">Description</string>
<string name="create_description_label">Description</string> <string name="configure_submit_label_create">Create</string>
<string name="create_complete_text">Create</string>
<string name="room_options_label">Room options</string> <string name="room_options_label">Room options</string>
<string name="error">Error</string> <string name="error">Error</string>
<string name="login_error_username_invalid">The entered username is not a valid Matrix ID.</string> <string name="login_error_username_invalid">The entered username is not a valid Matrix ID.</string>
<string name="login_error_wellknown_missing">Failed to detect well-known data for the specified Matrix homeserver. The server might not exist, be offline, or not be supporting well-known lookups.</string> <string name="login_error_wellknown_missing">Failed to detect well-known data for the specified Matrix homeserver. The server might not exist, be offline, or not be supporting well-known lookups.</string>
<string name="room_invitees_title">Invitees</string> <string name="room_invitees_title">Invitees</string>
<string name="room_rsvp_title">Your reply</string> <string name="room_rsvp_title">Your reply</string>
<string name="room_rsvp_sure_label">Sure!</string> <string name="rsvp_sure_label">Sure!</string>
<string name="room_rsvp_later_label">I\'ll be late…</string> <string name="rsvp_later_label">I\'ll be late…</string>
<string name="room_rsvp_maybe_label">Maybe?</string> <string name="rsvp_maybe_label">Maybe?</string>
<string name="room_rsvp_noway_label">Nope.</string> <string name="rsvp_noway_label">Nope.</string>
<string name="room_topic_title">About this party</string> <string name="room_topic_title">About this party</string>
<string name="user_unresolved_name">[unknown user]</string> <string name="user_unresolved_name">[unknown user]</string>
<string name="room_rsvp_sure_response">Will be there</string> <string name="rsvp_sure_response">Will be there</string>
<string name="room_rsvp_later_response">Will arrive late</string> <string name="rsvp_later_response">Will arrive late</string>
<string name="room_rsvp_maybe_response">Will maybe partecipate</string> <string name="rsvp_maybe_response">Will maybe partecipate</string>
<string name="room_rsvp_noway_response">Won\'t be there</string> <string name="rsvp_noway_response">Won\'t be there</string>
<string name="room_rsvp_sure_placeholder">Anything to add?</string> <string name="rsvp_sure_placeholder">Anything to add?</string>
<string name="room_rsvp_later_placeholder">Why will you be late?</string> <string name="rsvp_later_placeholder">Why will you be late?</string>
<string name="room_rsvp_maybe_placeholder">What will determine your partecipation?</string> <string name="rsvp_maybe_placeholder">What will determine your partecipation?</string>
<string name="room_rsvp_noway_placeholder">Why won\'t you partecipate?</string> <string name="rsvp_noway_placeholder">Why won\'t you partecipate?</string>
<string name="room_rsvp_update_label">Update</string>
<string name="error_session_missing">The Matrix session context has not been initialized.</string> <string name="error_session_missing">The Matrix session context has not been initialized.</string>
<string name="room_error_room_notfound">Could not find the requested Matrix room.</string> <string name="invite_error_room_notfound">Could not find the requested Matrix room.</string>
<string name="room_error_room_missing">The Matrix room context has not been initialized.</string> <string name="room_error_room_missing">The Matrix room context has not been initialized.</string>
<string name="room_error_roomsummary_missing">The Matrix room summary context has not been initialized.</string> <string name="room_error_roomsummary_missing">The Matrix room summary context has not been initialized.</string>
<string name="room_error_roomsummary_notfound">Could not find the requested Matrix room summary.</string> <string name="room_error_roomsummary_notfound">Could not find the requested Matrix room summary.</string>
<string name="room_invite_username_placeholder">\@steffotwo:candy.steffo.eu</string> <string name="invite_username_placeholder" translatable="false">\@steffotwo:candy.steffo.eu</string>
<string name="room_invite_username_label">User you want to invite</string> <string name="invite_username_label">User you want to invite</string>
<string name="room_rsvp_comment_label">Reason</string> <string name="room_rsvp_comment_label">Reason</string>
<string name="room_invite_button_label">Invite</string> <string name="invite_submit_label">Invite</string>
<string name="room_invite_title">Send an invite</string> <string name="invite_title">Send an invite</string>
<string name="room_rsvp_invited_label">Not opened</string> <string name="room_rsvp_invited_label">Not opened</string>
<string name="room_rsvp_invited_response">Hasn\'t opened the invite yet</string> <string name="room_rsvp_invited_response">Hasn\'t opened the invite yet</string>
<string name="main_room_leave_label">Leave party</string> <string name="main_room_leave_label">Leave party</string>
@ -75,18 +73,21 @@
<string name="room_options_edit_text">Edit party</string> <string name="room_options_edit_text">Edit party</string>
<string name="room_options_zoom_text">Zoom on avatar</string> <string name="room_options_zoom_text">Zoom on avatar</string>
<string name="room_error_members_notfound">Could not retrieve the list of room members.</string> <string name="room_error_members_notfound">Could not retrieve the list of room members.</string>
<string name="room_rsvp_nullish_placeholder">Leave a comment...</string> <string name="rsvp_nullish_placeholder">Leave a comment...</string>
<string name="room_rsvp_unknown_response">Has given an unsupported response</string> <string name="rsvp_unknown_response">Has given an unsupported response</string>
<string name="room_rsvp_none_response">Hasn\'t responded yet</string> <string name="rsvp_none_response">Hasn\'t responded yet</string>
<string name="room_rsvp_pending_response">Hasn\'t opened the invite yet</string> <string name="rsvp_pending_response">Hasn\'t opened the invite yet</string>
<string name="room_uninvite_label">Uninvite</string> <string name="room_uninvite_label">Uninvite</string>
<string name="room_error_publish_generic">Something went wrong while updating your RSVP: %1$s</string> <string name="room_error_publish_generic">Something went wrong while updating your RSVP: %1$s</string>
<string name="room_error_redact_generic">Your response has been updated, but something went wrong while attempting to remove your previous one: %1$s</string> <string name="room_error_redact_generic">Your response has been updated, but something went wrong while attempting to remove your previous one: %1$s</string>
<string name="room_error_self_notfound">You have been removed from the room.</string> <string name="room_error_self_notfound">You have been removed from the room.</string>
<string name="room_error_invite_generic">Something went wrong while sending the invite: %1$s</string> <string name="invite_error_invite_generic">Something went wrong while sending the invite: %1$s</string>
<string name="edit_title">Editing %1$s</string> <string name="configure_title_edit">Editing %1$s</string>
<string name="main_partecipants">%1$d partecipants</string> <string name="main_partecipantcount_text_plural">%1$d partecipants</string>
<string name="main_partecipant">%1$d partecipant</string> <string name="main_partecipantcount_text_singular">%1$d partecipant</string>
<string name="main_room_reject_label">Reject invite</string> <string name="main_room_reject_label">Reject invite</string>
<string name="main_error_join_generic">Something went wrong while opening the invite: %1$s</string> <string name="main_error_join_generic">Something went wrong while opening the invite: %1$s</string>
<string name="avatar_empty_placeholder" translatable="false">\?</string>
<string name="rsvp_nolabel">[unlabeled]</string>
<string name="configure_submit_label_update">Update</string>
</resources> </resources>