From 26e0c3443e2fae898c1fd4f5d326cc980acc51c8 Mon Sep 17 00:00:00 2001 From: AbronStudio Date: Thu, 7 Aug 2025 12:06:12 +0330 Subject: [PATCH] Refactor: Update string resources in ChannelSideDrawer for improved localization This commit enhances the ChannelSideDrawer component by replacing hardcoded strings with string resources, improving localization support and maintainability. - Updated content description for empty messages image. - Replaced static text with string resources for empty messages heading and body. - Updated text for the new conversation button to use string resources. --- .../composables/screens/chat/drawer/ChannelSideDrawer.kt | 8 ++++---- app/src/main/res/values/strings.xml | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/chat/revolt/composables/screens/chat/drawer/ChannelSideDrawer.kt b/app/src/main/java/chat/revolt/composables/screens/chat/drawer/ChannelSideDrawer.kt index 174ee672..053fb925 100644 --- a/app/src/main/java/chat/revolt/composables/screens/chat/drawer/ChannelSideDrawer.kt +++ b/app/src/main/java/chat/revolt/composables/screens/chat/drawer/ChannelSideDrawer.kt @@ -724,18 +724,18 @@ private fun ColumnScope.DirectMessagesChannelListRenderer( Image( modifier = Modifier.size(100.dp), painter = painterResource(R.drawable.empty_direct_messages_img), - contentDescription = "Empty Messages Sad Image" + contentDescription = stringResource(R.string.empty_messages_content_description) ) Spacer(Modifier.height(4.dp)) Text( - text = "It’s Quiet Here...", + text = stringResource(R.string.empty_messages_heading), style = MaterialTheme.typography.labelLarge, textAlign = TextAlign.Center, fontSize = 24.sp ) Spacer(Modifier.height(4.dp)) Text( - text = "Find friends to chat with or create a group conversation.", + text = stringResource(R.string.empty_messages_body), style = MaterialTheme.typography.bodyMedium, textAlign = TextAlign.Center ) @@ -751,7 +751,7 @@ private fun ColumnScope.DirectMessagesChannelListRenderer( bottomEnd = CornerSize(8.dp) ) ) { - Text(text = "New Conversation") + Text(text = stringResource(R.string.new_conversation)) } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ddae93a..cee96118 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,6 +17,10 @@ Privacy Policy Community Guidelines Message Friends + Empty Messages Sad Image + It\'s Quiet Here... + Find friends to chat with or create a group conversation. + New Conversation Welcome to PepChat! Join endless chats and connections; PepChat is your place to vibe with friends!