Poll history : use localazy strings

This commit is contained in:
ganfra 2023-12-12 14:36:07 +01:00
parent 7307e0fb13
commit a2c5cdf483
9 changed files with 81 additions and 66 deletions

View file

@ -38,10 +38,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme
import io.element.android.features.poll.api.pollcontent.PollContentView
import io.element.android.features.poll.impl.R
import io.element.android.features.poll.impl.history.model.PollHistoryFilter
import io.element.android.features.poll.impl.history.model.PollHistoryItem
import io.element.android.libraries.designsystem.components.button.BackButton
@ -55,6 +57,7 @@ import io.element.android.libraries.designsystem.theme.components.Surface
import io.element.android.libraries.designsystem.theme.components.Text
import io.element.android.libraries.designsystem.theme.components.TopAppBar
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.ui.strings.CommonStrings
import kotlinx.collections.immutable.ImmutableList
@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
@ -84,7 +87,7 @@ fun PollHistoryView(
TopAppBar(
title = {
Text(
text = "Polls", // TODO Polls: Localazy
text = stringResource(R.string.screen_polls_history_title),
style = ElementTheme.typography.aliasScreenTitle,
)
},
@ -149,7 +152,7 @@ private fun PollHistoryFilterButtons(
count = PollHistoryFilter.entries.size,
selected = activeFilter == filter,
onClick = { onFilterSelected(filter) },
text = filter.name
text = stringResource(filter.stringResource),
)
}
}
@ -184,7 +187,7 @@ private fun PollHistoryList(
if (hasMoreToLoad) {
item {
Button(
text = "Load more",
text = stringResource(CommonStrings.action_load_more),
showProgress = isLoading,
onClick = onLoadMore,
modifier = Modifier.padding(vertical = 24.dp),

View file

@ -16,7 +16,9 @@
package io.element.android.features.poll.impl.history.model
enum class PollHistoryFilter {
ONGOING,
PAST,
import io.element.android.features.poll.impl.R
enum class PollHistoryFilter(val stringResource: Int) {
ONGOING(R.string.screen_polls_history_filter_ongoing),
PAST(R.string.screen_polls_history_filter_past),
}

View file

@ -11,4 +11,9 @@
<string name="screen_edit_poll_delete_confirmation">"Are you sure you want to delete this poll?"</string>
<string name="screen_edit_poll_delete_confirmation_title">"Delete Poll"</string>
<string name="screen_edit_poll_title">"Edit poll"</string>
<string name="screen_polls_history_empty_ongoing">"Can\'t find any ongoing polls."</string>
<string name="screen_polls_history_empty_past">"Can\'t find any past polls."</string>
<string name="screen_polls_history_filter_ongoing">"Ongoing"</string>
<string name="screen_polls_history_filter_past">"Past"</string>
<string name="screen_polls_history_title">"Polls"</string>
</resources>

View file

@ -29,6 +29,7 @@ If you proceed, some of your settings may change."</string>
<string name="screen_notification_settings_enable_notifications">"Enable notifications on this device"</string>
<string name="screen_notification_settings_failed_fixing_configuration">"The configuration has not been corrected, please try again."</string>
<string name="screen_notification_settings_group_chats">"Group chats"</string>
<string name="screen_notification_settings_invite_for_me_label">"Invitations"</string>
<string name="screen_notification_settings_mentions_only_disclaimer">"Your homeserver does not support this option in encrypted rooms, you may not get notified in some rooms."</string>
<string name="screen_notification_settings_mentions_section_title">"Mentions"</string>
<string name="screen_notification_settings_mode_all">"All"</string>

View file

@ -385,7 +385,7 @@ private fun PollsSection(
) {
PreferenceCategory(modifier = modifier) {
ListItem(
headlineContent = { Text("Polls") }, // TODO Polls: Localazy
headlineContent = { Text(stringResource(R.string.screen_polls_history_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls)),
onClick = openPollHistory,
)

View file

@ -5,6 +5,7 @@
<item quantity="other">"%1$d people"</item>
</plurals>
<string name="screen_notification_settings_edit_failed_updating_default_mode">"An error occurred while updating the notification setting."</string>
<string name="screen_polls_history_title">"Polls"</string>
<string name="screen_room_details_add_topic_title">"Add topic"</string>
<string name="screen_room_details_already_a_member">"Already a member"</string>
<string name="screen_room_details_already_invited">"Already invited"</string>

View file

@ -3,6 +3,8 @@
<string name="screen_session_verification_cancelled_subtitle">"Something doesnt seem right. Either the request timed out or the request was denied."</string>
<string name="screen_session_verification_compare_emojis_subtitle">"Confirm that the emojis below match those shown on your other session."</string>
<string name="screen_session_verification_compare_emojis_title">"Compare emojis"</string>
<string name="screen_session_verification_compare_numbers_subtitle">"Confirm that the numbers below match those shown on your other session."</string>
<string name="screen_session_verification_compare_numbers_title">"Compare numbers"</string>
<string name="screen_session_verification_complete_subtitle">"Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted."</string>
<string name="screen_session_verification_open_existing_session_subtitle">"Prove its you in order to access your encrypted message history."</string>
<string name="screen_session_verification_open_existing_session_title">"Open an existing session"</string>

View file

@ -95,6 +95,7 @@
<string name="action_try_again">"Try again"</string>
<string name="action_view_source">"View source"</string>
<string name="action_yes">"Yes"</string>
<string name="action_load_more">"Load more"</string>
<string name="common_about">"About"</string>
<string name="common_acceptable_use_policy">"Acceptable use policy"</string>
<string name="common_advanced_settings">"Advanced settings"</string>
@ -109,6 +110,7 @@
<string name="common_dark">"Dark"</string>
<string name="common_decryption_error">"Decryption error"</string>
<string name="common_developer_options">"Developer options"</string>
<string name="common_direct_chat">"Direct chat"</string>
<string name="common_edited_suffix">"(edited)"</string>
<string name="common_editing">"Editing"</string>
<string name="common_emote">"* %1$s %2$s"</string>
@ -227,9 +229,6 @@
<item quantity="other">"%d votes"</item>
</plurals>
<string name="preference_rageshake">"Rageshake to report bug"</string>
<string name="screen_edit_poll_delete_confirmation">"Are you sure you want to delete this poll?"</string>
<string name="screen_edit_poll_delete_confirmation_title">"Delete Poll"</string>
<string name="screen_edit_poll_title">"Edit poll"</string>
<string name="screen_media_picker_error_failed_selection">"Failed selecting media, please try again."</string>
<string name="screen_media_upload_preview_error_failed_processing">"Failed processing media to upload, please try again."</string>
<string name="screen_media_upload_preview_error_failed_sending">"Failed uploading media, please try again."</string>

View file

@ -1,91 +1,91 @@
{
"modules": [
"modules" : [
{
"name": ":features:rageshake:impl",
"includeRegex": [
"name" : ":features:rageshake:impl",
"includeRegex" : [
"screen_bug_report_.*"
]
},
{
"name": ":features:rageshake:api",
"includeRegex": [
"name" : ":features:rageshake:api",
"includeRegex" : [
"crash_detection_.*",
"rageshake_detection_.*",
"settings_rageshake.*"
]
},
{
"name": ":features:logout:impl",
"includeRegex": [
"name" : ":features:logout:impl",
"includeRegex" : [
"screen_signout_.*"
]
},
{
"name": ":features:onboarding:impl",
"includeRegex": [
"name" : ":features:onboarding:impl",
"includeRegex" : [
"screen_onboarding_.*"
]
},
{
"name": ":features:signedout:impl",
"includeRegex": [
"name" : ":features:signedout:impl",
"includeRegex" : [
"screen_signed_out_.*"
]
},
{
"name": ":features:invitelist:impl",
"includeRegex": [
"name" : ":features:invitelist:impl",
"includeRegex" : [
"screen_invites_.*"
]
},
{
"name": ":features:createroom:impl",
"includeRegex": [
"name" : ":features:createroom:impl",
"includeRegex" : [
"screen_create_room_.*",
"screen_start_chat_.*"
]
},
{
"name": ":features:verifysession:impl",
"includeRegex": [
"name" : ":features:verifysession:impl",
"includeRegex" : [
"screen_session_verification_.*"
]
},
{
"name": ":libraries:textcomposer:impl",
"includeRegex": [
"name" : ":libraries:textcomposer:impl",
"includeRegex" : [
"rich_text_editor.*",
".*voice_message_tooltip"
]
},
{
"name": ":libraries:permissions:api",
"includeRegex": [
"name" : ":libraries:permissions:api",
"includeRegex" : [
"dialog\\.permission_.*"
]
},
{
"name": ":libraries:androidutils",
"includeRegex": [
"name" : ":libraries:androidutils",
"includeRegex" : [
"error_no_compatible_app_found"
]
},
{
"name": ":libraries:eventformatter:impl",
"includeRegex": [
"name" : ":libraries:eventformatter:impl",
"includeRegex" : [
"state_event_.*"
]
},
{
"name": ":libraries:push:impl",
"includeRegex": [
"name" : ":libraries:push:impl",
"includeRegex" : [
"push_.*",
"notification_.*"
]
},
{
"name": ":features:login:impl",
"includeRegex": [
"name" : ":features:login:impl",
"includeRegex" : [
"screen_login_.*",
"screen_server_confirmation_.*",
"screen_change_server_.*",
@ -95,32 +95,33 @@
]
},
{
"name": ":features:leaveroom:api",
"includeRegex": [
"name" : ":features:leaveroom:api",
"includeRegex" : [
"leave_room_alert_.*"
]
},
{
"name": ":features:roomlist:impl",
"includeRegex": [
"name" : ":features:roomlist:impl",
"includeRegex" : [
"screen_roomlist_.*",
"session_verification_banner_.*",
"confirm_recovery_key_banner_.*"
]
},
{
"name": ":features:roomdetails:impl",
"includeRegex": [
"name" : ":features:roomdetails:impl",
"includeRegex" : [
"screen_room_details_.*",
"screen_room_member_list_.*",
"screen_dm_details_.*",
"screen_room_notification_settings_.*",
"screen_notification_settings_edit_failed_updating_default_mode"
"screen_notification_settings_edit_failed_updating_default_mode",
"screen_polls_history_title"
]
},
{
"name": ":features:messages:impl",
"includeRegex": [
"name" : ":features:messages:impl",
"includeRegex" : [
"room_timeline_.*",
"screen_room_.*",
"screen\\.room\\..*",
@ -128,50 +129,51 @@
"emoji_picker_category_.*",
".*report_content_.*"
],
"excludeRegex": [
"excludeRegex" : [
"screen_room_details_.*",
"screen_room_member.*",
"screen_dm_.*"
]
},
{
"name": ":features:analytics:impl",
"includeRegex": [
"name" : ":features:analytics:impl",
"includeRegex" : [
"screen_analytics_prompt.*"
]
},
{
"name": ":features:analytics:api",
"includeRegex": [
"name" : ":features:analytics:api",
"includeRegex" : [
"screen_analytics_settings_.*"
]
},
{
"name": ":features:ftue:impl",
"includeRegex": [
"name" : ":features:ftue:impl",
"includeRegex" : [
"screen_welcome_.*",
"screen_migration_.*",
"screen_notification_optin_.*"
]
},
{
"name": ":features:poll:impl",
"includeRegex": [
"name" : ":features:poll:impl",
"includeRegex" : [
"screen_create_poll_.*",
"screen_edit_poll_.*"
"screen_edit_poll_.*",
"screen_polls_history_.*"
]
},
{
"name": ":features:securebackup:impl",
"includeRegex": [
"name" : ":features:securebackup:impl",
"includeRegex" : [
"screen_chat_backup_.*",
"screen_key_backup_disable_.*",
"screen_recovery_key_.*"
]
},
{
"name": ":features:preferences:impl",
"includeRegex": [
"name" : ":features:preferences:impl",
"includeRegex" : [
"screen_advanced_settings_.*",
"screen\\.advanced_settings\\..*",
"screen_edit_profile_.*",
@ -179,14 +181,14 @@
]
},
{
"name": ":features:call",
"includeRegex": [
"name" : ":features:call",
"includeRegex" : [
"call_.*"
]
},
{
"name": ":features:lockscreen:impl",
"includeRegex": [
"name" : ":features:lockscreen:impl",
"includeRegex" : [
"screen_app_lock_.*",
"screen_signout_in_progress_dialog_content"
]