Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various media gallery related tweaks #3616

Merged
merged 8 commits into from
Dec 13, 2024
17 changes: 14 additions & 3 deletions ElementX/Resources/Localizations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"action_view_in_timeline" = "View in timeline";
"action_view_source" = "View source";
"action_yes" = "Yes";
"action_yes_try_again" = "Yes, try again";
"banner_migrate_to_native_sliding_sync_action" = "Log Out & Upgrade";
"banner_migrate_to_native_sliding_sync_description" = "Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later.";
"banner_migrate_to_native_sliding_sync_force_logout_title" = "Your homeserver no longer supports the old protocol. Please log out and log back in to continue using the app.";
Expand All @@ -138,7 +139,8 @@
"common_creating_room" = "Creating room…";
"common_current_user_left_room" = "Left room";
"common_dark" = "Dark";
"common_date_separator_this_month" = "This month";
"common_date_date_at_time" = "%1$@ at %2$@";
"common_date_this_month" = "This month";
"common_decryption_error" = "Decryption error";
"common_developer_options" = "Developer options";
"common_device_id" = "Device ID";
Expand Down Expand Up @@ -379,7 +381,11 @@
"screen_knock_requests_list_accept_all_alert_description" = "Are you sure you want to accept all requests to join?";
"screen_knock_requests_list_accept_all_alert_title" = "Accept all requests";
"screen_knock_requests_list_accept_all_button_title" = "Accept all";
"screen_knock_requests_list_accept_all_failed_alert_description" = "We couldn’t accept all requests. Would you like to try again?";
"screen_knock_requests_list_accept_all_failed_alert_title" = "Failed to accept all requests";
"screen_knock_requests_list_accept_all_loading_title" = "Accepting all requests to join";
"screen_knock_requests_list_accept_failed_alert_description" = "We couldn’t accept this request. Would you like to try again?";
"screen_knock_requests_list_accept_failed_alert_title" = "Failed to accept request";
"screen_knock_requests_list_accept_loading_title" = "Accepting request to join";
"screen_knock_requests_list_ban_alert_confirm_button_title" = "Yes, decline and ban";
"screen_knock_requests_list_ban_alert_description" = "Are you sure you want to decline and ban %1$@? This user won’t be able to request access to join this room again.";
Expand All @@ -389,9 +395,12 @@
"screen_knock_requests_list_decline_alert_description" = "Are you sure you want to decline %1$@ request to join this room?";
"screen_knock_requests_list_decline_alert_title" = "Decline access";
"screen_knock_requests_list_decline_and_ban_action_title" = "Decline and ban";
"screen_knock_requests_list_decline_failed_alert_description" = "We couldn’t decline this request. Would you like to try again?";
"screen_knock_requests_list_decline_failed_alert_title" = "Failed to decline request";
"screen_knock_requests_list_decline_loading_title" = "Declining request to join";
"screen_knock_requests_list_empty_state_description" = "When somebody will ask to join the room, you’ll be able to see their request here.";
"screen_knock_requests_list_empty_state_title" = "No pending request to join";
"screen_knock_requests_list_initial_loading_title" = "Loading requests to join…";
"screen_knock_requests_list_title" = "Requests to join";
"screen_media_details_file_format" = "File format";
"screen_media_details_filename" = "File name";
Expand Down Expand Up @@ -615,12 +624,14 @@
"screen_login_title_with_homeserver" = "Sign in to %1$@";
"screen_media_browser_delete_confirmation_subtitle" = "This file will be removed from the room and members won’t have access to it.";
"screen_media_browser_delete_confirmation_title" = "Delete file?";
"screen_media_browser_empty_state_subtitle" = "Images and videos uploaded to this room will be shown here.";
"screen_media_browser_empty_state_title" = "No media uploaded yet";
"screen_media_browser_files_empty_state_subtitle" = "Documents, audio files, and voice messages uploaded to this room will be shown here.";
"screen_media_browser_files_empty_state_title" = "No files uploaded yet";
"screen_media_browser_list_loading_files" = "Loading files…";
"screen_media_browser_list_loading_media" = "Loading media…";
"screen_media_browser_list_mode_files" = "Files";
"screen_media_browser_list_mode_media" = "Media";
"screen_media_browser_media_empty_state_subtitle" = "Images and videos uploaded to this room will be shown here.";
"screen_media_browser_media_empty_state_title" = "No media uploaded yet";
"screen_media_browser_title" = "Media and files";
"screen_media_picker_error_failed_selection" = "Failed selecting media, please try again.";
"screen_migration_message" = "This is a one time process, thanks for waiting.";
Expand Down
34 changes: 29 additions & 5 deletions ElementX/Sources/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ internal enum L10n {
internal static var actionViewSource: String { return L10n.tr("Localizable", "action_view_source") }
/// Yes
internal static var actionYes: String { return L10n.tr("Localizable", "action_yes") }
/// Yes, try again
internal static var actionYesTryAgain: String { return L10n.tr("Localizable", "action_yes_try_again") }
/// Log Out & Upgrade
internal static var bannerMigrateToNativeSlidingSyncAction: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_action") }
/// Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later.
Expand Down Expand Up @@ -314,8 +316,12 @@ internal enum L10n {
internal static var commonCurrentUserLeftRoom: String { return L10n.tr("Localizable", "common_current_user_left_room") }
/// Dark
internal static var commonDark: String { return L10n.tr("Localizable", "common_dark") }
/// %1$@ at %2$@
internal static func commonDateDateAtTime(_ p1: Any, _ p2: Any) -> String {
return L10n.tr("Localizable", "common_date_date_at_time", String(describing: p1), String(describing: p2))
}
/// This month
internal static var commonDateSeparatorThisMonth: String { return L10n.tr("Localizable", "common_date_separator_this_month") }
internal static var commonDateThisMonth: String { return L10n.tr("Localizable", "common_date_this_month") }
/// Decryption error
internal static var commonDecryptionError: String { return L10n.tr("Localizable", "common_decryption_error") }
/// Developer options
Expand Down Expand Up @@ -1316,8 +1322,16 @@ internal enum L10n {
internal static var screenKnockRequestsListAcceptAllAlertTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_all_alert_title") }
/// Accept all
internal static var screenKnockRequestsListAcceptAllButtonTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_all_button_title") }
/// We couldn’t accept all requests. Would you like to try again?
internal static var screenKnockRequestsListAcceptAllFailedAlertDescription: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_all_failed_alert_description") }
/// Failed to accept all requests
internal static var screenKnockRequestsListAcceptAllFailedAlertTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_all_failed_alert_title") }
/// Accepting all requests to join
internal static var screenKnockRequestsListAcceptAllLoadingTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_all_loading_title") }
/// We couldn’t accept this request. Would you like to try again?
internal static var screenKnockRequestsListAcceptFailedAlertDescription: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_failed_alert_description") }
/// Failed to accept request
internal static var screenKnockRequestsListAcceptFailedAlertTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_failed_alert_title") }
/// Accepting request to join
internal static var screenKnockRequestsListAcceptLoadingTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_accept_loading_title") }
/// Yes, decline and ban
Expand All @@ -1340,12 +1354,18 @@ internal enum L10n {
internal static var screenKnockRequestsListDeclineAlertTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_decline_alert_title") }
/// Decline and ban
internal static var screenKnockRequestsListDeclineAndBanActionTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_decline_and_ban_action_title") }
/// We couldn’t decline this request. Would you like to try again?
internal static var screenKnockRequestsListDeclineFailedAlertDescription: String { return L10n.tr("Localizable", "screen_knock_requests_list_decline_failed_alert_description") }
/// Failed to decline request
internal static var screenKnockRequestsListDeclineFailedAlertTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_decline_failed_alert_title") }
/// Declining request to join
internal static var screenKnockRequestsListDeclineLoadingTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_decline_loading_title") }
/// When somebody will ask to join the room, you’ll be able to see their request here.
internal static var screenKnockRequestsListEmptyStateDescription: String { return L10n.tr("Localizable", "screen_knock_requests_list_empty_state_description") }
/// No pending request to join
internal static var screenKnockRequestsListEmptyStateTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_empty_state_title") }
/// Loading requests to join…
internal static var screenKnockRequestsListInitialLoadingTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_initial_loading_title") }
/// Requests to join
internal static var screenKnockRequestsListTitle: String { return L10n.tr("Localizable", "screen_knock_requests_list_title") }
/// This account has been deactivated.
Expand All @@ -1372,10 +1392,10 @@ internal enum L10n {
internal static var screenMediaBrowserDeleteConfirmationSubtitle: String { return L10n.tr("Localizable", "screen_media_browser_delete_confirmation_subtitle") }
/// Delete file?
internal static var screenMediaBrowserDeleteConfirmationTitle: String { return L10n.tr("Localizable", "screen_media_browser_delete_confirmation_title") }
/// Images and videos uploaded to this room will be shown here.
internal static var screenMediaBrowserEmptyStateSubtitle: String { return L10n.tr("Localizable", "screen_media_browser_empty_state_subtitle") }
/// No media uploaded yet
internal static var screenMediaBrowserEmptyStateTitle: String { return L10n.tr("Localizable", "screen_media_browser_empty_state_title") }
/// Documents, audio files, and voice messages uploaded to this room will be shown here.
internal static var screenMediaBrowserFilesEmptyStateSubtitle: String { return L10n.tr("Localizable", "screen_media_browser_files_empty_state_subtitle") }
/// No files uploaded yet
internal static var screenMediaBrowserFilesEmptyStateTitle: String { return L10n.tr("Localizable", "screen_media_browser_files_empty_state_title") }
/// Loading files…
internal static var screenMediaBrowserListLoadingFiles: String { return L10n.tr("Localizable", "screen_media_browser_list_loading_files") }
/// Loading media…
Expand All @@ -1384,6 +1404,10 @@ internal enum L10n {
internal static var screenMediaBrowserListModeFiles: String { return L10n.tr("Localizable", "screen_media_browser_list_mode_files") }
/// Media
internal static var screenMediaBrowserListModeMedia: String { return L10n.tr("Localizable", "screen_media_browser_list_mode_media") }
/// Images and videos uploaded to this room will be shown here.
internal static var screenMediaBrowserMediaEmptyStateSubtitle: String { return L10n.tr("Localizable", "screen_media_browser_media_empty_state_subtitle") }
/// No media uploaded yet
internal static var screenMediaBrowserMediaEmptyStateTitle: String { return L10n.tr("Localizable", "screen_media_browser_media_empty_state_title") }
/// Media and files
internal static var screenMediaBrowserTitle: String { return L10n.tr("Localizable", "screen_media_browser_title") }
/// File format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ class MediaEventsTimelineScreenViewModel: MediaEventsTimelineScreenViewModelType
let group = MediaEventsTimelineGroup(id: item.id.uniqueID.id,
title: titleForDate(item.timestamp),
items: currentItems)
currentItems = []
newGroups.append(group)
if !currentItems.isEmpty {
newGroups.append(group)
currentItems = []
}
} else {
currentItems.append(item)
}
Expand Down Expand Up @@ -176,7 +178,7 @@ class MediaEventsTimelineScreenViewModel: MediaEventsTimelineScreenViewModelType

private func titleForDate(_ date: Date) -> String {
if Calendar.current.isDate(date, equalTo: .now, toGranularity: .month) {
L10n.commonDateSeparatorThisMonth
L10n.commonDateThisMonth
} else {
date.formatted(.dateTime.month(.wide).year())
}
Expand Down
Loading
Loading