From ff9dcb6ce196c364605896df7b8d7bf199e77120 Mon Sep 17 00:00:00 2001 From: Alexandre Franke Date: Mon, 4 Mar 2024 23:35:34 +0100 Subject: [PATCH] strings: harmonize term for failures --- scripts/checks.sh | 40 +++++++++---------- src/account_chooser_dialog/mod.rs | 4 +- src/components/auth_dialog.rs | 2 +- src/components/avatar/data.rs | 2 +- src/components/location_viewer.rs | 10 ++--- src/components/user_page.rs | 26 ++++++------ src/contrib/qr_code.rs | 2 +- .../camera/camera_paintable/linux.rs | 4 +- src/contrib/qr_code_scanner/camera/linux.rs | 12 +++--- src/contrib/qr_code_scanner/mod.ui | 4 +- src/error_page.ui | 2 +- src/login/homeserver_page.rs | 10 ++--- src/login/method_page.rs | 2 +- src/login/mod.rs | 8 ++-- src/main.rs | 6 +-- src/secret/linux.rs | 16 ++++---- src/secret/mod.rs | 2 +- src/session/model/ignored_users.rs | 8 ++-- src/session/model/notifications/mod.rs | 2 +- .../notifications/notifications_settings.rs | 14 +++---- src/session/model/remote_room.rs | 4 +- src/session/model/remote_user.rs | 2 +- src/session/model/room/aliases.rs | 20 +++++----- src/session/model/room/event/mod.rs | 4 +- src/session/model/room/join_rule.rs | 2 +- src/session/model/room/member.rs | 2 +- src/session/model/room/member_list.rs | 4 +- src/session/model/room/mod.rs | 36 ++++++++--------- src/session/model/room/permissions.rs | 2 +- src/session/model/room/timeline/mod.rs | 10 ++--- src/session/model/room_list/mod.rs | 4 +- .../model/room_list/room_list_metainfo.rs | 8 ++-- src/session/model/session.rs | 10 ++--- src/session/model/user.rs | 6 +-- src/session/model/user_sessions_list/mod.rs | 6 +-- .../model/user_sessions_list/user_session.rs | 2 +- .../verification/identity_verification.rs | 30 +++++++------- .../model/verification/verification_list.rs | 8 ++-- .../general_page/change_password_subpage.rs | 2 +- .../deactivate_account_subpage.rs | 2 +- .../view/account_settings/general_page/mod.rs | 2 +- .../ignored_users_subpage/ignored_user_row.rs | 2 +- .../import_export_keys_subpage.rs | 4 +- .../user_sessions_page/mod.ui | 2 +- .../user_sessions_page/user_session_row.rs | 2 +- src/session/view/content/invite.rs | 4 +- .../content/room_details/general_page/mod.rs | 14 +++---- .../room_details/history_viewer/event.rs | 4 +- .../room_details/history_viewer/timeline.rs | 2 +- .../invite_subpage/invitee_list.rs | 2 +- .../room_details/invite_subpage/mod.rs | 4 +- .../view/content/room_history/item_row.rs | 6 +-- .../room_history/message_row/content.rs | 6 +-- .../message_toolbar/attachment_dialog.rs | 2 +- .../room_history/message_toolbar/mod.rs | 2 +- src/session/view/content/room_history/mod.rs | 8 ++-- src/session/view/content/room_history/mod.ui | 4 +- .../content/room_history/sender_avatar/mod.rs | 22 +++++----- .../room_history/verification_info_bar.rs | 4 +- .../view/create_dm_dialog/dm_user_list.rs | 2 +- src/session/view/create_dm_dialog/mod.rs | 6 +-- src/session/view/room_creation.rs | 2 +- src/session/view/sidebar/row.rs | 4 +- src/session_list/mod.rs | 6 +-- src/session_list/session_list_settings.rs | 4 +- src/system_settings/linux.rs | 6 +-- src/system_settings/mod.rs | 2 +- src/user_facing_error.rs | 2 +- src/utils/location/linux.rs | 6 +-- .../accept_request_page.rs | 4 +- .../cancelled_page.rs | 2 +- .../choose_method_page.rs | 6 +-- .../confirm_qr_code_page.rs | 4 +- .../no_supported_methods_page.rs | 2 +- .../qr_code_scanned_page.rs | 2 +- .../identity_verification_view/sas_page.rs | 4 +- .../scan_qr_code_page.rs | 6 +-- .../wait_for_other_page.rs | 2 +- .../session_verification_view.rs | 10 ++--- src/window.rs | 4 +- 80 files changed, 261 insertions(+), 261 deletions(-) diff --git a/scripts/checks.sh b/scripts/checks.sh index 74aea4a7..63bb2573 100755 --- a/scripts/checks.sh +++ b/scripts/checks.sh @@ -94,7 +94,7 @@ check_rustup() { curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly export PATH=$PATH:$HOME/.cargo/bin if ! which rustup &> /dev/null; then - echo -e "$Failed to install rustup" + echo -e "$Could not install rustup" exit 2 fi else @@ -107,7 +107,7 @@ check_rustup() { install_cargo() { check_rustup -i if ! which cargo >/dev/null 2>&1; then - echo -e "$Failed to install cargo" + echo -e "$Could not install cargo" exit 2 fi } @@ -115,7 +115,7 @@ install_cargo() { # Check if cargo is available. If not, ask to install it. check_cargo() { if ! which cargo >/dev/null 2>&1; then - echo "Unable to find cargo for pre-commit checks" + echo "Could not find cargo for pre-commit checks" if [[ $force_install -eq 1 ]]; then install_cargo @@ -139,7 +139,7 @@ check_cargo() { [Nn]* | "" ) exit 2 ;; - * ) + * ) echo $invalid ;; esac @@ -160,7 +160,7 @@ install_rustfmt() { echo -e "$Installing rustfmt…" rustup component add --toolchain nightly rustfmt if ! cargo +nightly fmt --version >/dev/null 2>&1; then - echo -e "$Failed to install rustfmt" + echo -e "$Could not install rustfmt" exit 2 fi } @@ -171,7 +171,7 @@ run_rustfmt() { if [[ $force_install -eq 1 ]]; then install_rustfmt elif [ ! -t 1 ]; then - echo "Unable to check Fractal’s code style, because rustfmt could not be run" + echo "Could not check Fractal’s code style, because rustfmt could not be run" exit 2 else echo "Rustfmt is needed to check Fractal’s code style, but it isn’t available" @@ -182,21 +182,21 @@ run_rustfmt() { while true; do echo -n "Install rustfmt? [y/N]: "; read yn < /dev/tty case $yn in - [Yy]* ) + [Yy]* ) install_rustfmt break ;; [Nn]* | "" ) exit 2 ;; - * ) + * ) echo $invalid ;; esac done fi fi - + echo -e "$Checking code style…" if [[ $verbose -eq 1 ]]; then @@ -239,7 +239,7 @@ install_typos() { echo -e "$Installing typos…" cargo install typos-cli if ! typos --version >/dev/null 2>&1; then - echo -e "$Failed to install typos" + echo -e "$Could not install typos" exit 2 fi } @@ -250,7 +250,7 @@ run_typos() { if [[ $force_install -eq 1 ]]; then install_typos elif [ ! -t 1 ]; then - echo "Unable to check spelling mistakes, because typos could not be run" + echo "Could not check spelling mistakes, because typos could not be run" exit 2 else echo "Typos is needed to check spelling mistakes, but it isn’t available" @@ -261,14 +261,14 @@ run_typos() { while true; do echo -n "Install typos? [y/N]: "; read yn < /dev/tty case $yn in - [Yy]* ) + [Yy]* ) install_typos break ;; [Nn]* | "" ) exit 2 ;; - * ) + * ) echo $invalid ;; esac @@ -358,7 +358,7 @@ check_potfiles() { # Get Rust files with regex 'gettext(_f)?\('. rs_files=(`grep -lIrE 'gettext(_f)?\(' src/*`) - + # Get Rust files with macros, regex 'gettext!\('. rs_macro_files=(`grep -lIrE 'gettext!\(' src/*`) @@ -374,7 +374,7 @@ check_potfiles() { diff ui_potfiles=("${to_diff1[@]}") ui_files=("${to_diff2[@]}") - + to_diff1=("${rs_skip[@]}") to_diff2=("${rs_files[@]}") diff @@ -504,7 +504,7 @@ install_cargo_sort() { echo -e "$Installing cargo-sort…" cargo install cargo-sort if ! cargo-sort --version >/dev/null 2>&1; then - echo -e "$Failed to install cargo-sort" + echo -e "$Could not install cargo-sort" exit 2 fi } @@ -515,7 +515,7 @@ run_cargo_sort() { if [[ $force_install -eq 1 ]]; then install_cargo_sort elif [ ! -t 1 ]; then - echo "Unable to check Cargo.toml sorting, because cargo-sort could not be run" + echo "Could not check Cargo.toml sorting, because cargo-sort could not be run" exit 2 else echo "Cargo-sort is needed to check the sorting in Cargo.toml, but it isn’t available" @@ -526,14 +526,14 @@ run_cargo_sort() { while true; do echo -n "Install cargo-sort? [y/N]: "; read yn < /dev/tty case $yn in - [Yy]* ) + [Yy]* ) install_cargo_sort break ;; [Nn]* | "" ) exit 2 ;; - * ) + * ) echo $invalid ;; esac @@ -581,7 +581,7 @@ esac; shift; done if [[ $git_staged -eq 1 ]]; then staged_files=`git diff --name-only --cached` if [[ -z $staged_files ]]; then - echo -e "$Failed to check files because none where staged" + echo -e "$Could not check files because none where staged" exit 2 fi else diff --git a/src/account_chooser_dialog/mod.rs b/src/account_chooser_dialog/mod.rs index b4c800a0..5d688d93 100644 --- a/src/account_chooser_dialog/mod.rs +++ b/src/account_chooser_dialog/mod.rs @@ -52,7 +52,7 @@ mod imp { fn closed(&self) { if let Some(sender) = self.sender.take() { if sender.send(None).is_err() { - error!("Failed to send selected session"); + error!("Could not send selected session"); } } } @@ -112,7 +112,7 @@ impl AccountChooserDialog { .map(|s| s.session_id()); if sender.send(session_id).is_err() { - error!("Failed to send selected session"); + error!("Could not send selected session"); } } diff --git a/src/components/auth_dialog.rs b/src/components/auth_dialog.rs index 6837eed0..5647c971 100644 --- a/src/components/auth_dialog.rs +++ b/src/components/auth_dialog.rs @@ -108,7 +108,7 @@ mod imp { fn response(&self, response: &str) { if let Some(sender) = self.sender.take() { if sender.send(response.to_owned()).is_err() { - error!("Failed to send response"); + error!("Could not send response"); } } } diff --git a/src/components/avatar/data.rs b/src/components/avatar/data.rs index fe6f9b91..085065cf 100644 --- a/src/components/avatar/data.rs +++ b/src/components/avatar/data.rs @@ -86,7 +86,7 @@ impl AvatarData { match icon { Ok(icon) => Some(icon), Err(error) => { - warn!("Failed to generate icon for notification: {error}"); + warn!("Could not generate icon for notification: {error}"); None } } diff --git a/src/components/location_viewer.rs b/src/components/location_viewer.rs index 7a704a26..285e2629 100644 --- a/src/components/location_viewer.rs +++ b/src/components/location_viewer.rs @@ -52,25 +52,25 @@ mod imp { "/org/gnome/Fractal/mapstyle/osm-liberty/style.json", gio::ResourceLookupFlags::NONE, ) - .expect("Failed to load map style"); + .expect("Could not load map style"); let source = shumate::VectorRenderer::new("vector-tiles", &String::from_utf8_lossy(&style)) - .expect("Failed to read map style"); + .expect("Could not read map style"); source.set_license("© OpenMapTiles © OpenStreetMap contributors"); source.set_license_uri("https://www.openstreetmap.org/copyright"); let spritepixbuf = gdk_pixbuf::Pixbuf::from_resource( "/org/gnome/Fractal/mapstyle/osm-liberty/sprites.png", ) - .expect("Failed to load map sprites"); + .expect("Could not load map sprites"); let spritejson = gio::resources_lookup_data( "/org/gnome/Fractal/mapstyle/osm-liberty/sprites.json", gio::ResourceLookupFlags::NONE, ) - .expect("Failed to load map sprite sheet"); + .expect("Could not load map sprite sheet"); source .set_sprite_sheet_data(&spritepixbuf, &String::from_utf8_lossy(&spritejson)) - .expect("Failed to set map sprite sheet"); + .expect("Could not set map sprite sheet"); self.map.set_map_source(Some(&source)); diff --git a/src/components/user_page.rs b/src/components/user_page.rs index eaf5dbab..9145620f 100644 --- a/src/components/user_page.rs +++ b/src/components/user_page.rs @@ -303,7 +303,7 @@ impl UserPage { self.set_direct_chat_loading(true); let Ok(room) = user.get_or_create_direct_chat().await else { - toast!(self, &gettext("Failed to create a new Direct Chat")); + toast!(self, &gettext("Could not create a new Direct Chat")); self.set_direct_chat_loading(false); return; @@ -484,7 +484,7 @@ impl UserPage { .await .is_err() { - toast!(obj, gettext("Failed to change the role")); + toast!(obj, gettext("Could not change the role")); obj.update_room(); } })); @@ -508,7 +508,7 @@ impl UserPage { let user_id = member.user_id().clone(); if room.invite(&[user_id]).await.is_err() { - toast!(obj, gettext("Failed to invite user")); + toast!(obj, gettext("Could not invite user")); } obj.reset_room() @@ -544,9 +544,9 @@ impl UserPage { let user_id = member.user_id().clone(); if room.kick(&[(user_id, response.reason)]).await.is_err() { let error = match member.membership() { - Membership::Invite => gettext("Failed to revoke invite of user"), - Membership::Knock => gettext("Failed to deny access to user"), - _ => gettext("Failed to kick user"), + Membership::Invite => gettext("Could not revoke invite of user"), + Membership::Knock => gettext("Could not deny access to user"), + _ => gettext("Could not kick user"), }; toast!(obj, error); @@ -594,7 +594,7 @@ impl UserPage { .await .is_err() { - toast!(obj, gettext("Failed to ban user")); + toast!(obj, gettext("Could not ban user")); } if response.remove_events { @@ -624,7 +624,7 @@ impl UserPage { let user_id = member.user_id().clone(); if room.unban(&[(user_id, None)]).await.is_err() { - toast!(obj, gettext("Failed to unban user")); + toast!(obj, gettext("Could not unban user")); } obj.reset_room(); @@ -675,8 +675,8 @@ impl UserPage { ngettext_f( // Translators: Do NOT translate the content between '{' and '}', // this is a variable name. - "Failed to remove 1 message sent by the user", - "Failed to remove {n} messages sent by the user", + "Could not remove 1 message sent by the user", + "Could not remove {n} messages sent by the user", n, &[("n", &n.to_string())] ) @@ -715,7 +715,7 @@ impl UserPage { let verification = match user.verify_identity().await { Ok(verification) => verification, Err(()) => { - toast!(self, gettext("Failed to start user verification")); + toast!(self, gettext("Could not start user verification")); self.action_set_enabled("user-page.verify-user", true); imp.verify_button.set_loading(false); return; @@ -765,10 +765,10 @@ impl UserPage { spawn!(clone!(@weak self as obj, @weak user => async move { if is_ignored { if user.stop_ignoring().await.is_err() { - toast!(obj, gettext("Failed to stop ignoring user")); + toast!(obj, gettext("Could not stop ignoring user")); } } else if user.ignore().await.is_err() { - toast!(obj, gettext("Failed to ignore user")); + toast!(obj, gettext("Could not ignore user")); } obj.imp().ignored_button.set_loading(false); diff --git a/src/contrib/qr_code.rs b/src/contrib/qr_code.rs index c5870014..a00924c4 100644 --- a/src/contrib/qr_code.rs +++ b/src/contrib/qr_code.rs @@ -146,7 +146,7 @@ impl QRCode { /// Sets the displayed code of `self` to a QR code generated from `bytes`. pub fn set_bytes(&self, bytes: &[u8]) { let data = QRCodeData::try_from(bytes).unwrap_or_else(|_| { - glib::g_warning!(None, "Failed to load QRCode from bytes"); + glib::g_warning!(None, "Could not load QRCode from bytes"); Default::default() }); self.imp().data.replace(data); diff --git a/src/contrib/qr_code_scanner/camera/camera_paintable/linux.rs b/src/contrib/qr_code_scanner/camera/camera_paintable/linux.rs index 533da5d1..ee0fd15a 100644 --- a/src/contrib/qr_code_scanner/camera/camera_paintable/linux.rs +++ b/src/contrib/qr_code_scanner/camera/camera_paintable/linux.rs @@ -196,7 +196,7 @@ impl LinuxCameraPaintable { glib::ControlFlow::Continue }), ) - .expect("Failed to add bus watch"); + .expect("Could not add bus watch"); let paintable = sink.property::("paintable"); @@ -207,7 +207,7 @@ impl LinuxCameraPaintable { paintable.connect_invalidate_contents(move |_| { if let Some(sender) = sender.take() { if sender.send(()).is_err() { - error!("Failed to send camera paintable `invalidate-contents` signal"); + error!("Could not send camera paintable `invalidate-contents` signal"); } } }); diff --git a/src/contrib/qr_code_scanner/camera/linux.rs b/src/contrib/qr_code_scanner/camera/linux.rs index 2378c560..3ac9b0be 100644 --- a/src/contrib/qr_code_scanner/camera/linux.rs +++ b/src/contrib/qr_code_scanner/camera/linux.rs @@ -34,7 +34,7 @@ mod imp { let camera = match camera::Camera::new().await { Ok(camera) => camera, Err(error) => { - error!("Failed to create instance of camera proxy: {error}"); + error!("Could not create instance of camera proxy: {error}"); return false; } }; @@ -42,7 +42,7 @@ mod imp { match camera.is_present().await { Ok(is_present) => is_present, Err(error) => { - error!("Failed to check whether system has cameras: {error}"); + error!("Could not check whether system has cameras: {error}"); false } } @@ -53,7 +53,7 @@ mod imp { Ok(is_present) => is_present.expect("The task should not have been aborted"), Err(_) => { abort_handle.abort(); - error!("Failed to check whether system has cameras: the request timed out"); + error!("Could not check whether system has cameras: the request timed out"); false } } @@ -79,18 +79,18 @@ mod imp { Some(paintable.upcast()) } Ok(None) => { - error!("Failed to request access to cameras: the response is empty"); + error!("Could not request access to cameras: the response is empty"); None } Err(error) => { - error!("Failed to request access to cameras: {error}"); + error!("Could not request access to cameras: {error}"); None } }, Err(_) => { // Error because we reached the timeout. abort_handle.abort(); - error!("Failed to request access to cameras: the request timed out"); + error!("Could not request access to cameras: the request timed out"); None } } diff --git a/src/contrib/qr_code_scanner/mod.ui b/src/contrib/qr_code_scanner/mod.ui index bbcc80aa..b37d74da 100644 --- a/src/contrib/qr_code_scanner/mod.ui +++ b/src/contrib/qr_code_scanner/mod.ui @@ -10,7 +10,7 @@ no-camera - Unable to Connect to Camera + Could not Connect to Camera vertical @@ -23,7 +23,7 @@ - Unable to Connect to Camera + Could not Connect to Camera diff --git a/src/error_page.ui b/src/error_page.ui index 0ac01f4b..5da5b6af 100644 --- a/src/error_page.ui +++ b/src/error_page.ui @@ -112,7 +112,7 @@ session - Failed to Initialize the Session + Could not Initialize the Session warning-symbolic true diff --git a/src/login/homeserver_page.rs b/src/login/homeserver_page.rs index 0c05951d..824d8af4 100644 --- a/src/login/homeserver_page.rs +++ b/src/login/homeserver_page.rs @@ -245,15 +245,15 @@ impl LoginHomeserverPage { match (discovery_error, server_error) { (Some(discovery_error), Some(server_error)) => { - warn!("Failed to discover homeserver. Auto-discovery error: {discovery_error}. Homeserver detection error: {server_error}"); + warn!("Could not discover homeserver. Auto-discovery error: {discovery_error}. Homeserver detection error: {server_error}"); Err(discovery_error) } (Some(discovery_error), None) => { - warn!("Failed to discover homeserver. Auto-discovery error: {discovery_error}"); + warn!("Could not discover homeserver. Auto-discovery error: {discovery_error}"); Err(discovery_error) } (None, Some(server_error)) => { - warn!("Failed to discover homeserver. Homeserver detection error: {server_error}"); + warn!("Could not discover homeserver. Homeserver detection error: {server_error}"); Err(server_error) } // We should have at least one error at this step. @@ -297,8 +297,8 @@ impl LoginHomeserverPage { login.show_login_screen(); } Err(error) => { - warn!("Failed to get available login types: {error}"); - toast!(self, "Failed to get available login types."); + warn!("Could not get available login types: {error}"); + toast!(self, "Could not get available login types."); // Drop the client because it is bound to the homeserver. login.drop_client(); diff --git a/src/login/method_page.rs b/src/login/method_page.rs index 47f6153c..952fd651 100644 --- a/src/login/method_page.rs +++ b/src/login/method_page.rs @@ -235,7 +235,7 @@ impl LoginMethodPage { login.handle_login_response(response).await; } Err(error) => { - warn!("Failed to log in: {error}"); + warn!("Could not log in: {error}"); toast!(self, error.to_user_facing()); } } diff --git a/src/login/mod.rs b/src/login/mod.rs index 12d24d0d..7945e245 100644 --- a/src/login/mod.rs +++ b/src/login/mod.rs @@ -453,7 +453,7 @@ impl Login { self.handle_login_response(response).await; } Err(error) => { - warn!("Failed to log in: {error}"); + warn!("Could not log in: {error}"); toast!(self, error.to_user_facing()); self.go_previous(); } @@ -472,7 +472,7 @@ impl Login { self.init_session(session).await; } Err(error) => { - warn!("Failed to create session: {error}"); + warn!("Could not create session: {error}"); toast!(self, error.to_user_facing()); self.go_previous(); @@ -488,7 +488,7 @@ impl Login { // Save ID of logging in session to GSettings let settings = Application::default().settings(); if let Err(err) = settings.set_string("current-session", session.session_id()) { - warn!("Failed to save current session: {err}"); + warn!("Could not save current session: {err}"); } let session_info = session.info().clone(); @@ -496,7 +496,7 @@ impl Login { if let Err(error) = handle.await.unwrap() { error!("Could not store session: {error}"); - toast!(self, gettext("Unable to store session")); + toast!(self, gettext("Could not store session")); } session.connect_ready(clone!(@weak self as obj => move |_| { diff --git a/src/main.rs b/src/main.rs index 1de132b2..fce326a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,9 +55,9 @@ fn main() { gtk::glib::set_application_name("Fractal"); - gtk::init().expect("Unable to start GTK4"); - gst::init().expect("Failed to initialize gst"); - gst_gtk::plugin_register_static().expect("Failed to initialize gstreamer gtk plugins"); + gtk::init().expect("Could not start GTK4"); + gst::init().expect("Could not initialize gst"); + gst_gtk::plugin_register_static().expect("Could not initialize gstreamer gtk plugins"); let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file"); gio::resources_register(&res); diff --git a/src/secret/linux.rs b/src/secret/linux.rs index 1b2538e3..9732e5c6 100644 --- a/src/secret/linux.rs +++ b/src/secret/linux.rs @@ -66,7 +66,7 @@ pub async fn restore_sessions() -> Result, SecretError> { } Err(LinuxSecretError::WrongProfile) => {} Err(error) => { - error!("Failed to restore previous session: {error}"); + error!("Could not restore previous session: {error}"); } } } @@ -103,7 +103,7 @@ pub async fn store_session(session: StoredSession) -> Result<(), SecretError> { pub async fn delete_session(session: StoredSession) { spawn_tokio!(async move { if let Err(error) = session.delete_from_secret_service().await { - error!("Failed to delete session data from Secret Service: {error}"); + error!("Could not delete session data from Secret Service: {error}"); } }) .await @@ -117,11 +117,11 @@ async fn log_out_session(session: StoredSession) { match matrix::client_with_stored_session(session).await { Ok(client) => { if let Err(error) = client.matrix_auth().logout().await { - error!("Failed to log out session: {error}"); + error!("Could not log out session: {error}"); } } Err(error) => { - error!("Failed to build client to log out session: {error}") + error!("Could not build client to log out session: {error}") } } }) @@ -303,11 +303,11 @@ impl StoredSession { debug!("Moving database to: {}", target_path.to_string_lossy()); if let Err(error) = fs::create_dir_all(&target_path) { - error!("Failed to create new directory: {error}"); + error!("Could not create new directory: {error}"); } if let Err(error) = fs::rename(&self.path, &target_path) { - error!("Failed to move database: {error}"); + error!("Could not move database: {error}"); } self.path = target_path; @@ -319,11 +319,11 @@ impl StoredSession { let clone = self.clone(); spawn_tokio!(async move { if let Err(error) = item.delete().await { - error!("Failed to remove outdated session: {error}"); + error!("Could not remove outdated session: {error}"); } if let Err(error) = store_session(clone).await { - error!("Failed to store updated session: {error}"); + error!("Could not store updated session: {error}"); } }) .await diff --git a/src/secret/mod.rs b/src/secret/mod.rs index 090165c5..dcb3cd52 100644 --- a/src/secret/mod.rs +++ b/src/secret/mod.rs @@ -156,7 +156,7 @@ impl StoredSession { spawn_tokio!(async move { if let Err(error) = fs::remove_dir_all(self.path).await { - error!("Failed to remove session database: {error}"); + error!("Could not remove session database: {error}"); } }) .await diff --git a/src/session/model/ignored_users.rs b/src/session/model/ignored_users.rs index 1c6b4d76..1071f24d 100644 --- a/src/session/model/ignored_users.rs +++ b/src/session/model/ignored_users.rs @@ -131,7 +131,7 @@ mod imp { return; } Err(error) => { - error!("Failed to get ignored users list: {error}"); + error!("Could not get ignored users list: {error}"); return; } }; @@ -139,7 +139,7 @@ mod imp { match raw.deserialize() { Ok(content) => self.update_list(content.ignored_users.into_keys().collect()), Err(error) => { - error!("Failed to deserialize ignored users list: {error}"); + error!("Could not deserialize ignored users list: {error}"); } } } @@ -228,7 +228,7 @@ impl IgnoredUsers { Ok(()) } Err(error) => { - error!("Failed to add `{user_id}` to the ignored users: {error}"); + error!("Could not add `{user_id}` to the ignored users: {error}"); Err(()) } } @@ -260,7 +260,7 @@ impl IgnoredUsers { Ok(()) } Err(error) => { - error!("Failed to remove `{user_id}` from the ignored users: {error}"); + error!("Could not remove `{user_id}` from the ignored users: {error}"); Err(()) } } diff --git a/src/session/model/notifications/mod.rs b/src/session/model/notifications/mod.rs index 25eccff9..6935faaf 100644 --- a/src/session/model/notifications/mod.rs +++ b/src/session/model/notifications/mod.rs @@ -124,7 +124,7 @@ impl Notifications { let sender = match handle.await.unwrap() { Ok(member) => member, Err(error) => { - error!("Failed to get member for notification: {error}"); + error!("Could not get member for notification: {error}"); None } }; diff --git a/src/session/model/notifications/notifications_settings.rs b/src/session/model/notifications/notifications_settings.rs index 802034f1..bb1e66de 100644 --- a/src/session/model/notifications/notifications_settings.rs +++ b/src/session/model/notifications/notifications_settings.rs @@ -251,7 +251,7 @@ impl NotificationsSettings { // The rule disables notifications, so we need to invert the boolean. Ok(enabled) => !enabled, Err(error) => { - error!("Failed to get account notifications setting: {error}"); + error!("Could not get account notifications setting: {error}"); true } }; @@ -295,7 +295,7 @@ impl NotificationsSettings { Ok(()) } Err(error) => { - error!("Failed to change account notifications setting: {error}"); + error!("Could not change account notifications setting: {error}"); Err(error) } } @@ -328,11 +328,11 @@ impl NotificationsSettings { if let Err(error) = set_default_rooms_notifications_all(api.clone(), false, group_all).await { - error!("Failed to change global group chats notifications setting: {error}"); + error!("Could not change global group chats notifications setting: {error}"); return Err(error); } if let Err(error) = set_default_rooms_notifications_all(api, true, one_to_one_all).await { - error!("Failed to change global 1-to-1 chats notifications setting: {error}"); + error!("Could not change global 1-to-1 chats notifications setting: {error}"); return Err(error); } @@ -406,7 +406,7 @@ impl NotificationsSettings { let handle = spawn_tokio!(async move { api.remove_keyword(&keyword_clone).await }); if let Err(error) = handle.await.unwrap() { - error!("Failed to remove notification keyword `{keyword}`: {error}"); + error!("Could not remove notification keyword `{keyword}`: {error}"); return Err(error); } @@ -426,7 +426,7 @@ impl NotificationsSettings { let handle = spawn_tokio!(async move { api.add_keyword(keyword_clone).await }); if let Err(error) = handle.await.unwrap() { - error!("Failed to add notification keyword `{keyword}`: {error}"); + error!("Could not add notification keyword `{keyword}`: {error}"); return Err(error); } @@ -515,7 +515,7 @@ impl NotificationsSettings { }; if let Err(error) = handle.await.unwrap() { - error!("Failed to update notifications setting for room `{room_id}`: {error}"); + error!("Could not update notifications setting for room `{room_id}`: {error}"); return Err(error); } diff --git a/src/session/model/remote_room.rs b/src/session/model/remote_room.rs index 6155c4b6..cbcb5a03 100644 --- a/src/session/model/remote_room.rs +++ b/src/session/model/remote_room.rs @@ -240,7 +240,7 @@ impl RemoteRoom { match handle.await.unwrap() { Ok(response) => response.room_id, Err(error) => { - error!("Failed to resolve room alias `{}`: {error}", uri.id); + error!("Could not resolve room alias `{}`: {error}", uri.id); imp.set_loading_state(LoadingState::Error); return; } @@ -272,7 +272,7 @@ impl RemoteRoom { } } Err(error) => { - error!("Failed to get room details for room `{}`: {error}", uri.id); + error!("Could not get room details for room `{}`: {error}", uri.id); imp.set_loading_state(LoadingState::Error); } } diff --git a/src/session/model/remote_user.rs b/src/session/model/remote_user.rs index 581e52b6..9612dcb8 100644 --- a/src/session/model/remote_user.rs +++ b/src/session/model/remote_user.rs @@ -53,7 +53,7 @@ impl RemoteUser { let profile = match handle.await.unwrap() { Ok(profile) => profile, Err(error) => { - error!("Failed to load profile for user `{user_id}`: {error}"); + error!("Could not load profile for user `{user_id}`: {error}"); return; } }; diff --git a/src/session/model/room/aliases.rs b/src/session/model/room/aliases.rs index a0e9ba81..23a0b4e7 100644 --- a/src/session/model/room/aliases.rs +++ b/src/session/model/room/aliases.rs @@ -203,7 +203,7 @@ impl RoomAliases { // We shouldn't need to load this is an invited room. Ok(_) => return Ok(None), Err(error) => { - error!("Failed to get canonical alias event: {error}"); + error!("Could not get canonical alias event: {error}"); return Err(()); } }; @@ -213,7 +213,7 @@ impl RoomAliases { // The redacted event doesn't have a content. Ok(_) => Ok(None), Err(error) => { - error!("Failed to deserialize canonical alias event: {error}"); + error!("Could not deserialize canonical alias event: {error}"); Err(()) } } @@ -249,7 +249,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to remove canonical alias: {error}"); + error!("Could not remove canonical alias: {error}"); Err(()) } } @@ -295,7 +295,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to set canonical alias: {error}"); + error!("Could not set canonical alias: {error}"); Err(()) } } @@ -334,7 +334,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to remove alt alias: {error}"); + error!("Could not remove alt alias: {error}"); Err(()) } } @@ -377,7 +377,7 @@ impl RoomAliases { } } Err(error) => { - error!("Failed to check room alias: {error}"); + error!("Could not check room alias: {error}"); if error .as_client_api_error() .is_some_and(|e| e.status_code == StatusCode::NOT_FOUND) @@ -396,7 +396,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to add alt alias: {error}"); + error!("Could not add alt alias: {error}"); Err(AddAltAliasError::Other) } } @@ -421,7 +421,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(response) => Ok(response.aliases), Err(error) => { - error!("Failed to fetch local room aliases: {error}"); + error!("Could not fetch local room aliases: {error}"); Err(()) } } @@ -443,7 +443,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to unregister local alias: {error}"); + error!("Could not unregister local alias: {error}"); Err(()) } } @@ -469,7 +469,7 @@ impl RoomAliases { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to register local alias: {error}"); + error!("Could not register local alias: {error}"); if error .as_client_api_error() diff --git a/src/session/model/room/event/mod.rs b/src/session/model/room/event/mod.rs index 17a7b7a7..4f86eea8 100644 --- a/src/session/model/room/event/mod.rs +++ b/src/session/model/room/event/mod.rs @@ -565,7 +565,7 @@ impl Event { EventSendState::NotSentYet => return MessageState::Sending, EventSendState::SendingFailed { error } => { if self.state() != MessageState::Error { - error!("Failed to send message: {error}"); + error!("Could not send message: {error}"); } return MessageState::Error; @@ -695,7 +695,7 @@ impl Event { pub async fn get_media_content(&self) -> Result<(String, Vec), matrix_sdk::Error> { let Some(session) = self.room().session() else { return Err(matrix_sdk::Error::UnknownError( - "Failed to upgrade Session".into(), + "Could not upgrade Session".into(), )); }; let TimelineItemContent::Message(message) = self.content() else { diff --git a/src/session/model/room/join_rule.rs b/src/session/model/room/join_rule.rs index 61482616..65eaea33 100644 --- a/src/session/model/room/join_rule.rs +++ b/src/session/model/room/join_rule.rs @@ -403,7 +403,7 @@ impl JoinRule { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to change join rule: {error}"); + error!("Could not change join rule: {error}"); Err(()) } } diff --git a/src/session/model/room/member.rs b/src/session/model/room/member.rs index 5440028e..fb4ffae6 100644 --- a/src/session/model/room/member.rs +++ b/src/session/model/room/member.rs @@ -213,7 +213,7 @@ impl Member { debug!("Room member {} not found", self.user_id()); } Err(error) => { - error!("Failed to load room member {}: {error}", self.user_id()); + error!("Could not load room member {}: {error}", self.user_id()); } } } diff --git a/src/session/model/room/member_list.rs b/src/session/model/room/member_list.rs index 54cdfc37..05e895a1 100644 --- a/src/session/model/room/member_list.rs +++ b/src/session/model/room/member_list.rs @@ -153,7 +153,7 @@ impl MemberList { } } Err(error) => { - error!("Failed to load room members from store: {error}"); + error!("Could not load room members from store: {error}"); } } @@ -175,7 +175,7 @@ impl MemberList { } Err(error) => { self.set_state(LoadingState::Error); - error!(%error, "Failed to load room members from server"); + error!(%error, "Could not load room members from server"); } } } diff --git a/src/session/model/room/mod.rs b/src/session/model/room/mod.rs index 445dc9cb..34fcd44b 100644 --- a/src/session/model/room/mod.rs +++ b/src/session/model/room/mod.rs @@ -500,7 +500,7 @@ impl Room { match handle.await.unwrap() { Ok(is_direct) => self.set_is_direct(is_direct), Err(error) => { - error!(room_id = %self.room_id(), "Failed to load whether room is direct: {error}"); + error!(room_id = %self.room_id(), "Could not load whether room is direct: {error}"); } } } @@ -537,7 +537,7 @@ impl Room { let members = match handle.await.unwrap() { Ok(m) => m, Err(error) => { - error!("Failed to load room members: {error}"); + error!("Could not load room members: {error}"); vec![] } }; @@ -606,7 +606,7 @@ impl Room { } Ok(None) => {} Err(error) => { - error!("Failed to get direct member: {error}"); + error!("Could not get direct member: {error}"); } } @@ -651,7 +651,7 @@ impl Room { Ok(()) } Err(error) => { - error!("Couldn’t forget the room: {error}"); + error!("Could not forget the room: {error}"); // Load the previous category self.load_category(); @@ -1041,7 +1041,7 @@ impl Room { Ok(Some(matrix_member)) => own_member.update_from_room_member(&matrix_member), Ok(None) => {} Err(error) => error!( - "Failed to load own member for room {}: {error}", + "Could not load own member for room {}: {error}", self.room_id() ), } @@ -1145,7 +1145,7 @@ impl Room { self.set_display_name(name); } - Err(error) => error!("Couldn’t fetch display name: {error}"), + Err(error) => error!("Could not fetch display name: {error}"), }; if self.display_name().is_empty() { @@ -1175,7 +1175,7 @@ impl Room { Ok(Some(member)) => member, Ok(None) => return, Err(error) => { - error!("Failed to get room member: {error}"); + error!("Could not get room member: {error}"); return; } }; @@ -1194,7 +1194,7 @@ impl Room { Ok(Some(member)) => member, Ok(None) => return, Err(error) => { - error!("Failed to get room member: {error}"); + error!("Could not get room member: {error}"); return; } }; @@ -1311,7 +1311,7 @@ impl Room { let handle = spawn_tokio!(async move { timeline.toggle_reaction(&annotation).await }); if let Err(error) = handle.await.unwrap() { - error!("Failed to toggle reaction: {error}"); + error!("Could not toggle reaction: {error}"); return Err(()); } @@ -1341,7 +1341,7 @@ impl Room { match matrix_room.redact(event_id, reason.as_deref(), None).await { Ok(_) => {} Err(error) => { - error!("Failed to redact event with ID {event_id}: {error}"); + error!("Could not redact event with ID {event_id}: {error}"); failed_redactions.push(i); } } @@ -1377,7 +1377,7 @@ impl Room { clone!(@weak self as obj => async move { match handle.await.unwrap() { Ok(_) => {}, - Err(error) => error!("Couldn’t send typing notification: {error}"), + Err(error) => error!("Could not send typing notification: {error}"), }; }) ); @@ -1681,7 +1681,7 @@ impl Room { match result { Ok(_) => {} Err(error) => { - error!("Failed to invite user with ID {}: {error}", user_ids[index],); + error!("Could not invite user with ID {}: {error}", user_ids[index],); failed_invites.push(&*user_ids[index]); } } @@ -1718,7 +1718,7 @@ impl Room { match result { Ok(_) => {} Err(error) => { - error!("Failed to kick user with ID {}: {error}", users[index].0); + error!("Could not kick user with ID {}: {error}", users[index].0); failed_kicks.push(&*users[index].0); } } @@ -1755,7 +1755,7 @@ impl Room { match result { Ok(_) => {} Err(error) => { - error!("Failed to ban user with ID {}: {error}", users[index].0); + error!("Could not ban user with ID {}: {error}", users[index].0); failed_bans.push(&*users[index].0); } } @@ -1792,7 +1792,7 @@ impl Room { match result { Ok(_) => {} Err(error) => { - error!("Failed to unban user with ID {}: {error}", users[index].0); + error!("Could not unban user with ID {}: {error}", users[index].0); failed_unbans.push(&*users[index].0); } } @@ -1860,7 +1860,7 @@ impl Room { } Ok(false) => {} Err(error) => { - error!("Failed to load room encryption state: {error}"); + error!("Could not load room encryption state: {error}"); } } } @@ -1878,7 +1878,7 @@ impl Room { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to enabled room encryption: {error}"); + error!("Could not enabled room encryption: {error}"); Err(()) } } @@ -2036,7 +2036,7 @@ impl Room { Ok(_) => {} Err(error) => { error!( - "Failed to report content with event ID {}: {error}", + "Could not report content with event ID {}: {error}", events[index].0, ); failed.push(&*events[index].0); diff --git a/src/session/model/room/permissions.rs b/src/session/model/room/permissions.rs index 3dd91995..9d03c8c6 100644 --- a/src/session/model/room/permissions.rs +++ b/src/session/model/room/permissions.rs @@ -556,7 +556,7 @@ impl Permissions { match handle.await.unwrap() { Ok(_) => Ok(()), Err(error) => { - error!("Failed to set user power level: {error}"); + error!("Could not set user power level: {error}"); Err(()) } } diff --git a/src/session/model/room/timeline/mod.rs b/src/session/model/room/timeline/mod.rs index 9ef65ac4..7b8b6817 100644 --- a/src/session/model/room/timeline/mod.rs +++ b/src/session/model/room/timeline/mod.rs @@ -463,7 +463,7 @@ impl Timeline { }); if let Err(error) = handle.await.unwrap() { - error!("Failed to load timeline: {error}"); + error!("Could not load timeline: {error}"); self.set_state(TimelineState::Error); } } @@ -513,7 +513,7 @@ impl Timeline { event.raw().unwrap().deserialize().map_err(Into::into) } else { let Some(room) = self.room() else { - return Err(MatrixError::UnknownError("Failed to upgrade Room".into())); + return Err(MatrixError::UnknownError("Could not upgrade Room".into())); }; let matrix_room = room.matrix_room().clone(); let event_id_clone = event_id.clone(); @@ -591,7 +591,7 @@ impl Timeline { let matrix_timeline = match handle.await.unwrap() { Ok(t) => t, Err(error) => { - error!("Failed to create timeline: {error}"); + error!("Could not create timeline: {error}"); return; } }; @@ -811,7 +811,7 @@ fn is_event_redactable(event: &Event) -> bool { false } Err(error) => { - error!("Failed to deserialize unsigned field in event: {error}"); + error!("Could not deserialize unsigned field in event: {error}"); false } }; @@ -827,7 +827,7 @@ fn is_event_redactable(event: &Event) -> bool { true } Err(error) => { - error!("Failed to deserialize type field in event: {error}"); + error!("Could not deserialize type field in event: {error}"); true } } diff --git a/src/session/model/room_list/mod.rs b/src/session/model/room_list/mod.rs index 21de550a..2adbce4e 100644 --- a/src/session/model/room_list/mod.rs +++ b/src/session/model/room_list/mod.rs @@ -378,7 +378,7 @@ impl RoomList { via: Vec, ) -> Result { let Some(session) = self.session() else { - return Err("Failed to upgrade Session".to_owned()); + return Err("Could not upgrade Session".to_owned()); }; let client = session.client(); let identifier_clone = identifier.clone(); @@ -403,7 +403,7 @@ impl RoomList { let error = gettext_f( // Translators: Do NOT translate the content between '{' and '}', this is a // variable name. - "Failed to join room {room_name}. Try again later.", + "Could not join room {room_name}. Try again later.", &[("room_name", identifier.as_str())], ); diff --git a/src/session/model/room_list/room_list_metainfo.rs b/src/session/model/room_list/room_list_metainfo.rs index db80ecd5..a6be8440 100644 --- a/src/session/model/room_list/room_list_metainfo.rs +++ b/src/session/model/room_list/room_list_metainfo.rs @@ -47,13 +47,13 @@ impl RoomListMetainfo { Ok(Some(value)) => match serde_json::from_slice(&value) { Ok(metainfo) => metainfo, Err(error) => { - error!("Failed to deserialize rooms metainfo: {error}"); + error!("Could not deserialize rooms metainfo: {error}"); Default::default() } }, Ok(None) => Default::default(), Err(error) => { - error!("Failed to load rooms metainfo: {error}"); + error!("Could not load rooms metainfo: {error}"); Default::default() } }; @@ -146,7 +146,7 @@ impl RoomListMetainfoInner { let value = match serde_json::to_vec(rooms_metainfo) { Ok(value) => value, Err(error) => { - error!("Failed to serialize rooms metainfo: {error}"); + error!("Could not serialize rooms metainfo: {error}"); return; } }; @@ -160,7 +160,7 @@ impl RoomListMetainfoInner { }); if let Err(error) = handle.await.unwrap() { - error!("Failed to store rooms metainfo: {error}"); + error!("Could not store rooms metainfo: {error}"); } } diff --git a/src/session/model/session.rs b/src/session/model/session.rs index 3507e3b5..a27bfb8c 100644 --- a/src/session/model/session.rs +++ b/src/session/model/session.rs @@ -286,7 +286,7 @@ impl Session { false } Err(error) => { - error!("Failed to get session’s encryption profile: {error}"); + error!("Could not get session’s encryption profile: {error}"); false } } @@ -342,7 +342,7 @@ impl Session { user.set_name(res.displayname); user.set_avatar_url(res.avatar_url); } - Err(error) => error!("Couldn’t fetch account metadata: {error}"), + Err(error) => error!("Could not fetch account metadata: {error}"), } }); } @@ -425,7 +425,7 @@ impl Session { self.handle_logged_out(); } } - error!("Failed to perform sync: {error}"); + error!("Could not perform sync: {error}"); } } } @@ -447,9 +447,9 @@ impl Session { Ok(()) } Err(error) => { - error!("Couldn’t logout the session: {error}"); + error!("Could not logout the session: {error}"); - Err(gettext("Failed to logout the session.")) + Err(gettext("Could not logout the session.")) } } } diff --git a/src/session/model/user.rs b/src/session/model/user.rs index 396873d9..02e92ebf 100644 --- a/src/session/model/user.rs +++ b/src/session/model/user.rs @@ -154,7 +154,7 @@ impl User { match handle.await.unwrap() { Ok(identity) => identity, Err(error) => { - error!("Failed to find crypto identity: {error}"); + error!("Could not find crypto identity: {error}"); None } } @@ -216,7 +216,7 @@ impl User { Ok(room) } Err(error) => { - error!("Failed to create direct chat: {error}"); + error!("Could not create direct chat: {error}"); Err(error) } } @@ -309,7 +309,7 @@ pub trait UserExt: IsA { user.set_avatar_url(response.avatar_url); }, Err(error) => { - error!("Failed to load user profile for {}: {}", user.user_id(), error); + error!("Could not load user profile for {}: {}", user.user_id(), error); } }; })); diff --git a/src/session/model/user_sessions_list/mod.rs b/src/session/model/user_sessions_list/mod.rs index 06e10fb5..6b008bd8 100644 --- a/src/session/model/user_sessions_list/mod.rs +++ b/src/session/model/user_sessions_list/mod.rs @@ -140,7 +140,7 @@ impl UserSessionsList { let stream = match client.encryption().devices_stream().await { Ok(stream) => stream, Err(error) => { - error!("Failed to access the user sessions stream: {error}"); + error!("Could not access the user sessions stream: {error}"); return; } }; @@ -198,7 +198,7 @@ impl UserSessionsList { let crypto_sessions = match client.encryption().get_user_devices(&user_id).await { Ok(crypto_sessions) => Some(crypto_sessions), Err(error) => { - error!("Failed to get crypto sessions for user {user_id}: {error}"); + error!("Could not get crypto sessions for user {user_id}: {error}"); None } }; @@ -212,7 +212,7 @@ impl UserSessionsList { api_sessions = Some(response.devices); } Err(error) => { - error!("Failed to get sessions list for user {user_id}: {error}"); + error!("Could not get sessions list for user {user_id}: {error}"); } } } diff --git a/src/session/model/user_sessions_list/user_session.rs b/src/session/model/user_sessions_list/user_session.rs index f81d7fa2..c8112a58 100644 --- a/src/session/model/user_sessions_list/user_session.rs +++ b/src/session/model/user_sessions_list/user_session.rs @@ -194,7 +194,7 @@ impl UserSession { if matches!(error, AuthError::UserCancelled) { debug!("Deletion of user session {device_id} cancelled by user"); } else { - error!("Failed to delete user session {device_id}: {error:?}"); + error!("Could not delete user session {device_id}: {error:?}"); } Err(error) } diff --git a/src/session/model/verification/identity_verification.rs b/src/session/model/verification/identity_verification.rs index 72ea4bf2..ee51fbf8 100644 --- a/src/session/model/verification/identity_verification.rs +++ b/src/session/model/verification/identity_verification.rs @@ -236,7 +236,7 @@ mod imp { if !request.is_done() && !request.is_passive() && !request.is_cancelled() { spawn_tokio!(async move { if let Err(error) = request.cancel().await { - error!("Failed to cancel verification request on dispose: {error}"); + error!("Could not cancel verification request on dispose: {error}"); } }); } @@ -249,7 +249,7 @@ mod imp { self.request.set(request.clone()).unwrap(); let Ok(datetime) = glib::DateTime::now_local() else { - error!("Failed to get current GDateTime"); + error!("Could not get current GDateTime"); return; }; @@ -571,7 +571,7 @@ impl IdentityVerification { Ok(()) } Err(error) => { - error!("Failed to cancel verification request: {error}"); + error!("Could not cancel verification request: {error}"); Err(error) } } @@ -593,7 +593,7 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(()) => Ok(()), Err(error) => { - error!("Failed to accept verification request: {error}"); + error!("Could not accept verification request: {error}"); Err(()) } } @@ -713,7 +713,7 @@ impl IdentityVerification { if !self.we_started_sas() { let handle = spawn_tokio!(async move { sas_verification.accept().await }); if let Err(error) = handle.await.unwrap() { - error!("Failed to accept SAS verification: {error}"); + error!("Could not accept SAS verification: {error}"); imp.set_state(VerificationState::Error); } } @@ -778,11 +778,11 @@ impl IdentityVerification { let qr_verification = match handle.await.unwrap() { Ok(Some(qr_verification)) => qr_verification, Ok(None) => { - error!("Failed to start QR verification generation: unknown reason"); + error!("Could not start QR verification generation: unknown reason"); return false; } Err(error) => { - error!("Failed to start QR verification generation: {error}"); + error!("Could not start QR verification generation: {error}"); return false; } }; @@ -793,7 +793,7 @@ impl IdentityVerification { true } Err(error) => { - error!("Failed to generate verification QR code: {error}"); + error!("Could not generate verification QR code: {error}"); false } } @@ -836,11 +836,11 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(Some(_)) => Ok(()), Ok(None) => { - error!("Failed to validate scanned verification QR code: unknown reason"); + error!("Could not validate scanned verification QR code: unknown reason"); Err(()) } Err(error) => { - error!("Failed to validate scanned verification QR code: {error}"); + error!("Could not validate scanned verification QR code: {error}"); Err(()) } } @@ -858,7 +858,7 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(()) => Ok(()), Err(error) => { - error!("Failed to confirm scanned verification QR code: {error}"); + error!("Could not confirm scanned verification QR code: {error}"); Err(()) } } @@ -877,13 +877,13 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(Some(_)) => Ok(()), Ok(None) => { - error!("Failed to start SAS verification: unknown reason"); + error!("Could not start SAS verification: unknown reason"); // Unset it because it didn't work. self.set_we_started_sas(false); Err(()) } Err(error) => { - error!("Failed to start SAS verification: {error}"); + error!("Could not start SAS verification: {error}"); // Unset it because it didn't work. self.set_we_started_sas(false); Err(()) @@ -903,7 +903,7 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(()) => Ok(()), Err(error) => { - error!("Failed to send SAS verification mismatch: {error}"); + error!("Could not send SAS verification mismatch: {error}"); Err(()) } } @@ -921,7 +921,7 @@ impl IdentityVerification { match handle.await.unwrap() { Ok(()) => Ok(()), Err(error) => { - error!("Failed to send SAS verification match: {error}"); + error!("Could not send SAS verification match: {error}"); Err(()) } } diff --git a/src/session/model/verification/verification_list.rs b/src/session/model/verification/verification_list.rs index 4f78ef00..d72473e5 100644 --- a/src/session/model/verification/verification_list.rs +++ b/src/session/model/verification/verification_list.rs @@ -220,7 +220,7 @@ impl VerificationList { } Err(error) => { error!( - "Failed to get room member for verification request `({}, {})`: {error}", + "Could not get room member for verification request `({}, {})`: {error}", request.other_user_id(), request.flow_id() ); @@ -280,7 +280,7 @@ impl VerificationList { /// user and sent to other devices. pub async fn create(&self, user: Option) -> Result { let Some(session) = self.session() else { - error!("Failed to create identity verification: failed to upgrade session"); + error!("Could not create identity verification: failed to upgrade session"); return Err(()); }; @@ -289,7 +289,7 @@ impl VerificationList { let supported_methods = load_supported_verification_methods().await; let Some(identity) = user.crypto_identity().await else { - error!("Failed to create identity verification: cryptographic identity not found"); + error!("Could not create identity verification: cryptographic identity not found"); return Err(()); }; @@ -321,7 +321,7 @@ impl VerificationList { Ok(verification) } Err(error) => { - error!("Failed to create identity verification: {error}"); + error!("Could not create identity verification: {error}"); Err(()) } } diff --git a/src/session/view/account_settings/general_page/change_password_subpage.rs b/src/session/view/account_settings/general_page/change_password_subpage.rs index 7475978b..83abe396 100644 --- a/src/session/view/account_settings/general_page/change_password_subpage.rs +++ b/src/session/view/account_settings/general_page/change_password_subpage.rs @@ -257,7 +257,7 @@ impl ChangePasswordSubpage { toast!(self, gettext("Password rejected for being too weak")); } _ => { - error!("Failed to change the password: {error:?}"); + error!("Could not change the password: {error:?}"); toast!(self, gettext("Could not change password")); } }, diff --git a/src/session/view/account_settings/general_page/deactivate_account_subpage.rs b/src/session/view/account_settings/general_page/deactivate_account_subpage.rs index 8ec23fb1..af1ac254 100644 --- a/src/session/view/account_settings/general_page/deactivate_account_subpage.rs +++ b/src/session/view/account_settings/general_page/deactivate_account_subpage.rs @@ -148,7 +148,7 @@ impl DeactivateAccountSubpage { .unwrap(); } Err(error) => { - error!("Failed to deactivate account: {error:?}"); + error!("Could not deactivate account: {error:?}"); toast!(self, gettext("Could not deactivate account")); } } diff --git a/src/session/view/account_settings/general_page/mod.rs b/src/session/view/account_settings/general_page/mod.rs index fb85d200..84a455f3 100644 --- a/src/session/view/account_settings/general_page/mod.rs +++ b/src/session/view/account_settings/general_page/mod.rs @@ -306,7 +306,7 @@ impl GeneralPage { // still the current action. if weak_action.is_ongoing() { imp.changing_avatar.take(); - error!("Couldn’t remove user avatar: {error}"); + error!("Could not remove user avatar: {error}"); toast!(self, gettext("Could not remove avatar")); avatar.reset(); } diff --git a/src/session/view/account_settings/security_page/ignored_users_subpage/ignored_user_row.rs b/src/session/view/account_settings/security_page/ignored_users_subpage/ignored_user_row.rs index c7e40145..dcc7ddd5 100644 --- a/src/session/view/account_settings/security_page/ignored_users_subpage/ignored_user_row.rs +++ b/src/session/view/account_settings/security_page/ignored_users_subpage/ignored_user_row.rs @@ -98,7 +98,7 @@ impl IgnoredUserRow { spawn!( clone!(@weak self as obj, @weak ignored_users => async move { if ignored_users.remove(&user_id).await.is_err() { - toast!(obj, gettext("Failed to stop ignoring user")); + toast!(obj, gettext("Could not stop ignoring user")); obj.imp().stop_ignoring_button.set_loading(false); } }) diff --git a/src/session/view/account_settings/security_page/import_export_keys_subpage.rs b/src/session/view/account_settings/security_page/import_export_keys_subpage.rs index 99149556..5e180afc 100644 --- a/src/session/view/account_settings/security_page/import_export_keys_subpage.rs +++ b/src/session/view/account_settings/security_page/import_export_keys_subpage.rs @@ -366,7 +366,7 @@ impl ImportExportKeysSubpage { } Err(err) => { if is_export { - error!("Failed to export the keys: {err:?}"); + error!("Could not export the keys: {err:?}"); toast!(self, gettext("Could not export the keys")); } else if err .downcast_ref::() @@ -380,7 +380,7 @@ impl ImportExportKeysSubpage { gettext("The passphrase doesn't match the one used to export the keys.") ); } else { - error!("Failed to import the keys: {err:?}"); + error!("Could not import the keys: {err:?}"); toast!(self, gettext("Could not import the keys")); } } diff --git a/src/session/view/account_settings/user_sessions_page/mod.ui b/src/session/view/account_settings/user_sessions_page/mod.ui index 3d930186..d7c069fb 100644 --- a/src/session/view/account_settings/user_sessions_page/mod.ui +++ b/src/session/view/account_settings/user_sessions_page/mod.ui @@ -82,7 +82,7 @@ error-symbolic Error - Failed to load the list of connected devices. + Could not load the list of connected devices. true diff --git a/src/session/view/account_settings/user_sessions_page/user_session_row.rs b/src/session/view/account_settings/user_sessions_page/user_session_row.rs index 001645e7..9e7ea1c2 100644 --- a/src/session/view/account_settings/user_sessions_page/user_session_row.rs +++ b/src/session/view/account_settings/user_sessions_page/user_session_row.rs @@ -159,7 +159,7 @@ impl UserSessionRow { Err(_) => { let device_name = user_session.display_name(); // Translators: Do NOT translate the content between '{' and '}', this is a variable name. - let error_message = gettext_f("Failed to disconnect device “{device_name}”", &[("device_name", &device_name)]); + let error_message = gettext_f("Could not disconnect device “{device_name}”", &[("device_name", &device_name)]); toast!(obj, error_message); }, } diff --git a/src/session/view/content/invite.rs b/src/session/view/content/invite.rs index 8c2ae2e3..301aef57 100644 --- a/src/session/view/content/invite.rs +++ b/src/session/view/content/invite.rs @@ -204,7 +204,7 @@ impl Invite { gettext( // Translators: Do NOT translate the content between '{' and '}', this // is a variable name. - "Failed to accept invitation for {room}. Try again later.", + "Could not accept invitation for {room}. Try again later.", ), @room, ); @@ -237,7 +237,7 @@ impl Invite { gettext( // Translators: Do NOT translate the content between '{' and '}', this // is a variable name. - "Failed to decline invitation for {room}. Try again later.", + "Could not decline invitation for {room}. Try again later.", ), @room, ); diff --git a/src/session/view/content/room_details/general_page/mod.rs b/src/session/view/content/room_details/general_page/mod.rs index 9586e39c..07722d99 100644 --- a/src/session/view/content/room_details/general_page/mod.rs +++ b/src/session/view/content/room_details/general_page/mod.rs @@ -1091,7 +1091,7 @@ impl GeneralPage { if let Err(error) = handle.await.unwrap() { error!("Could not change guest access: {error}"); - toast!(obj, gettext("Failed to change guest access")); + toast!(obj, gettext("Could not change guest access")); obj.update_guest_access(); } })); @@ -1147,7 +1147,7 @@ impl GeneralPage { row.set_is_active(is_published); } Err(error) => { - error!("Failed to get directory visibility of room: {error}"); + error!("Could not get directory visibility of room: {error}"); } } @@ -1187,9 +1187,9 @@ impl GeneralPage { if let Err(error) = handle.await.unwrap() { error!("Could not change directory visibility of room: {error}"); let text = if publish { - gettext("Failed to publish room in directory") + gettext("Could not publish room in directory") } else { - gettext("Failed to unpublish room from directory") + gettext("Could not unpublish room from directory") }; toast!(obj, text); } @@ -1265,7 +1265,7 @@ impl GeneralPage { let handle = spawn_tokio!(async move { matrix_room.send_state_event(content).await }); if let Err(error) = handle.await.unwrap() { - error!("Failed to change room history visibility: {error}"); + error!("Could not change room history visibility: {error}"); toast!(obj, gettext("Could not change who can read history")); obj.update_history_visibility(); @@ -1328,7 +1328,7 @@ impl GeneralPage { }; if room.enable_encryption().await.is_err() { - toast!(obj, gettext("Failed to enable encryption")); + toast!(obj, gettext("Could not enable encryption")); obj.update_encryption(); } })); @@ -1398,7 +1398,7 @@ impl GeneralPage { } Err(error) => { error!("Could not upgrade room: {error}"); - toast!(self, gettext("Failed to upgrade room")); + toast!(self, gettext("Could not upgrade room")); imp.upgrade_button.set_loading(false); } } diff --git a/src/session/view/content/room_details/history_viewer/event.rs b/src/session/view/content/room_details/history_viewer/event.rs index 5c133d4e..d32a1e1e 100644 --- a/src/session/view/content/room_details/history_viewer/event.rs +++ b/src/session/view/content/room_details/history_viewer/event.rs @@ -149,12 +149,12 @@ impl HistoryViewerEvent { pub async fn get_file_content(&self) -> Result<(String, Vec), matrix_sdk::Error> { let Some(room) = self.room() else { return Err(matrix_sdk::Error::UnknownError( - "Failed to upgrade Room".into(), + "Could not upgrade Room".into(), )); }; let Some(session) = room.session() else { return Err(matrix_sdk::Error::UnknownError( - "Failed to upgrade Session".into(), + "Could not upgrade Session".into(), )); }; let client = session.client(); diff --git a/src/session/view/content/room_details/history_viewer/timeline.rs b/src/session/view/content/room_details/history_viewer/timeline.rs index 0912051b..7030ff0d 100644 --- a/src/session/view/content/room_details/history_viewer/timeline.rs +++ b/src/session/view/content/room_details/history_viewer/timeline.rs @@ -145,7 +145,7 @@ impl HistoryViewerTimeline { } }, Err(error) => { - error!("Failed to load history viewer timeline events: {error}"); + error!("Could not load history viewer timeline events: {error}"); self.set_state(TimelineState::Error); false } diff --git a/src/session/view/content/room_details/invite_subpage/invitee_list.rs b/src/session/view/content/room_details/invite_subpage/invitee_list.rs index be961acf..a3f42d74 100644 --- a/src/session/view/content/room_details/invite_subpage/invitee_list.rs +++ b/src/session/view/content/room_details/invite_subpage/invitee_list.rs @@ -272,7 +272,7 @@ impl InviteeList { self.set_list(users); } Err(error) => { - error!("Couldn’t load matching users: {error}"); + error!("Could not load matching users: {error}"); self.set_state(InviteeListState::Error); self.clear_list(); } diff --git a/src/session/view/content/room_details/invite_subpage/mod.rs b/src/session/view/content/room_details/invite_subpage/mod.rs index bdcddb88..88b119d0 100644 --- a/src/session/view/content/room_details/invite_subpage/mod.rs +++ b/src/session/view/content/room_details/invite_subpage/mod.rs @@ -233,8 +233,8 @@ impl InviteSubpage { ngettext( // Translators: Do NOT translate the content between '{' and '}', these // are variable names. - "Failed to invite {user} to {room}. Try again later.", - "Failed to invite {n} users to {room}. Try again later.", + "Could not invite {user} to {room}. Try again later.", + "Could not invite {n} users to {room}. Try again later.", n as u32, ), @user = first_failed, diff --git a/src/session/view/content/room_history/item_row.rs b/src/session/view/content/room_history/item_row.rs index cc65491b..9f9f032b 100644 --- a/src/session/view/content/room_history/item_row.rs +++ b/src/session/view/content/room_history/item_row.rs @@ -714,7 +714,7 @@ impl ItemRow { } if event.room().redact(&[event_id], None).await.is_err() { - toast!(self, gettext("Failed to remove message")); + toast!(self, gettext("Could not remove message")); } } @@ -728,7 +728,7 @@ impl ItemRow { }; if event.room().toggle_reaction(key, event_id).await.is_err() { - toast!(self, gettext("Failed to toggle reaction")); + toast!(self, gettext("Could not toggle reaction")); } } @@ -781,7 +781,7 @@ impl ItemRow { .await .is_err() { - toast!(self, gettext("Failed to report event")); + toast!(self, gettext("Could not report event")); } } } diff --git a/src/session/view/content/room_history/message_row/content.rs b/src/session/view/content/room_history/message_row/content.rs index 59cd3321..8185f7d8 100644 --- a/src/session/view/content/room_history/message_row/content.rs +++ b/src/session/view/content/room_history/message_row/content.rs @@ -111,14 +111,14 @@ impl MessageContent { glib::Priority::HIGH, clone!(@weak event => async move { if let Err(error) = event.fetch_missing_details().await { - error!("Failed to fetch event details: {error}"); + error!("Could not fetch event details: {error}"); } }) ); } TimelineDetails::Error(error) => { error!( - "Failed to fetch replied to event '{}': {error}", + "Could not fetch replied to event '{}': {error}", event.reply_to_id().unwrap() ); } @@ -346,7 +346,7 @@ fn build_content( parent.set_child(Some(&child)); child }; - child.with_text(gettext("Unable to decrypt this message, decryption will be retried once the keys are available."), format); + child.with_text(gettext("Could not decrypt this message, decryption will be retried once the keys are available."), format); } TimelineItemContent::RedactedMessage => { let child = if let Some(child) = parent.child().and_downcast::() { diff --git a/src/session/view/content/room_history/message_toolbar/attachment_dialog.rs b/src/session/view/content/room_history/message_toolbar/attachment_dialog.rs index ae20eb38..9bbfd5b9 100644 --- a/src/session/view/content/room_history/message_toolbar/attachment_dialog.rs +++ b/src/session/view/content/room_history/message_toolbar/attachment_dialog.rs @@ -72,7 +72,7 @@ mod imp { pub(super) fn send_response(&self, response: gtk::ResponseType) { if let Some(sender) = self.sender.take() { if sender.send(response).is_err() { - error!("Failed to send attachment dialog response {response:?}"); + error!("Could not send attachment dialog response {response:?}"); } } } diff --git a/src/session/view/content/room_history/message_toolbar/mod.rs b/src/session/view/content/room_history/message_toolbar/mod.rs index 238ad757..5f7046cc 100644 --- a/src/session/view/content/room_history/message_toolbar/mod.rs +++ b/src/session/view/content/room_history/message_toolbar/mod.rs @@ -741,7 +741,7 @@ impl MessageToolbar { fn location_error_toast(&self, error: LocationError) { let msg = match error { LocationError::Cancelled => gettext("The location request has been cancelled."), - LocationError::Other => gettext("Failed to retrieve current location."), + LocationError::Other => gettext("Could not retrieve current location."), }; toast!(self, msg); diff --git a/src/session/view/content/room_history/mod.rs b/src/session/view/content/room_history/mod.rs index fcab0e82..4ac2ea72 100644 --- a/src/session/view/content/room_history/mod.rs +++ b/src/session/view/content/room_history/mod.rs @@ -542,7 +542,7 @@ impl RoomHistory { self, gettext( // Translators: Do NOT translate the content between '{' and '}', this is a variable name. - "Failed to leave {room}", + "Could not leave {room}", ), @room, ); @@ -561,7 +561,7 @@ impl RoomHistory { gettext_f( // Translators: Do NOT translate the content between '{' and '}', this is a // variable name. - "Failed to join room {room_name}. Try again later.", + "Could not join room {room_name}. Try again later.", &[("room_name", &room.display_name())], ) ); @@ -578,7 +578,7 @@ impl RoomHistory { toast!( self, // Translators: Do NOT translate the content between '{' and '}', this is a variable name. - gettext("Failed to forget {room}."), + gettext("Could not forget {room}."), @room, ); } @@ -917,7 +917,7 @@ impl RoomHistory { }); if let Err(error) = handle.await.unwrap() { - error!("Failed to send read receipt: {error}"); + error!("Could not send read receipt: {error}"); } } diff --git a/src/session/view/content/room_history/mod.ui b/src/session/view/content/room_history/mod.ui index f7aadd50..b41b5d53 100644 --- a/src/session/view/content/room_history/mod.ui +++ b/src/session/view/content/room_history/mod.ui @@ -190,14 +190,14 @@ error - Unable to Load Room + Could not Load Room True True True error-symbolic - Unable to Load Room + Could not Load Room Check your network connection. diff --git a/src/session/view/content/room_history/sender_avatar/mod.rs b/src/session/view/content/room_history/sender_avatar/mod.rs index 18b473a1..a38c363f 100644 --- a/src/session/view/content/room_history/sender_avatar/mod.rs +++ b/src/session/view/content/room_history/sender_avatar/mod.rs @@ -481,7 +481,7 @@ impl SenderAvatar { match sender.get_or_create_direct_chat().await { Ok(room) => room, Err(_) => { - toast!(self, &gettext("Failed to create a new Direct Chat")); + toast!(self, &gettext("Could not create a new Direct Chat")); return; } } @@ -505,7 +505,7 @@ impl SenderAvatar { let room = sender.room(); let user_id = sender.user_id().clone(); if room.invite(&[user_id]).await.is_err() { - toast!(self, gettext("Failed to invite user")); + toast!(self, gettext("Could not invite user")); } } @@ -538,9 +538,9 @@ impl SenderAvatar { let user_id = sender.user_id().clone(); if room.kick(&[(user_id, response.reason)]).await.is_err() { let error = match membership { - Membership::Invite => gettext("Failed to revoke invite of user"), - Membership::Knock => gettext("Failed to deny access to user"), - _ => gettext("Failed to kick user"), + Membership::Invite => gettext("Could not revoke invite of user"), + Membership::Knock => gettext("Could not deny access to user"), + _ => gettext("Could not kick user"), }; toast!(self, error); } @@ -578,7 +578,7 @@ impl SenderAvatar { .await .is_err() { - toast!(self, gettext("Failed to ban user")); + toast!(self, gettext("Could not ban user")); } if response.remove_events { @@ -598,7 +598,7 @@ impl SenderAvatar { let room = sender.room(); let user_id = sender.user_id().clone(); if room.unban(&[(user_id, None)]).await.is_err() { - toast!(self, gettext("Failed to unban user")); + toast!(self, gettext("Could not unban user")); } } @@ -652,8 +652,8 @@ impl SenderAvatar { ngettext_f( // Translators: Do NOT translate the content between '{' and '}', // this is a variable name. - "Failed to remove 1 message sent by the user", - "Failed to remove {n} messages sent by the user", + "Could not remove 1 message sent by the user", + "Could not remove {n} messages sent by the user", n, &[("n", &n.to_string())] ) @@ -677,10 +677,10 @@ impl SenderAvatar { if is_ignored { if sender.stop_ignoring().await.is_err() { - toast!(self, gettext("Failed to stop ignoring user")); + toast!(self, gettext("Could not stop ignoring user")); } } else if sender.ignore().await.is_err() { - toast!(self, gettext("Failed to ignore user")); + toast!(self, gettext("Could not ignore user")); } } } diff --git a/src/session/view/content/room_history/verification_info_bar.rs b/src/session/view/content/room_history/verification_info_bar.rs index cee0c010..ac4bc5f1 100644 --- a/src/session/view/content/room_history/verification_info_bar.rs +++ b/src/session/view/content/room_history/verification_info_bar.rs @@ -63,7 +63,7 @@ mod imp { spawn!( clone!(@weak obj, @weak verification, @weak window => async move { if verification.accept().await.is_err() { - toast!(obj, gettext("Failed to accept verification")); + toast!(obj, gettext("Could not accept verification")); } else { window.session_view().select_verification(verification); } @@ -79,7 +79,7 @@ mod imp { spawn!(clone!(@weak obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to decline verification")); + toast!(obj, gettext("Could not decline verification")); } })); }); diff --git a/src/session/view/create_dm_dialog/dm_user_list.rs b/src/session/view/create_dm_dialog/dm_user_list.rs index 0b3e4aa7..68b62026 100644 --- a/src/session/view/create_dm_dialog/dm_user_list.rs +++ b/src/session/view/create_dm_dialog/dm_user_list.rs @@ -194,7 +194,7 @@ impl DmUserList { self.set_list(users); } Err(error) => { - error!("Couldn’t load matching users: {error}"); + error!("Could not load matching users: {error}"); self.set_state(DmUserListState::Error); self.clear_list(); } diff --git a/src/session/view/create_dm_dialog/mod.rs b/src/session/view/create_dm_dialog/mod.rs index 5a69ca8f..6ad6d1db 100644 --- a/src/session/view/create_dm_dialog/mod.rs +++ b/src/session/view/create_dm_dialog/mod.rs @@ -69,7 +69,7 @@ mod imp { fn closed(&self) { if let Some(sender) = self.sender.take() { if sender.send(None).is_err() { - error!("Failed to send selected session"); + error!("Could not send selected session"); } } } @@ -169,7 +169,7 @@ impl CreateDmDialog { if let Some(sender) = imp.sender.take() { if sender.send(Some(user)).is_err() { - error!("Failed to send selected session"); + error!("Could not send selected session"); } } } @@ -195,7 +195,7 @@ impl CreateDmDialog { self.close(); } Err(_) => { - self.show_error(&gettext("Failed to create a new Direct Chat")); + self.show_error(&gettext("Could not create a new Direct Chat")); self.imp().search_entry.set_sensitive(true); } } diff --git a/src/session/view/room_creation.rs b/src/session/view/room_creation.rs index 7b5563a9..ea22c5b9 100644 --- a/src/session/view/room_creation.rs +++ b/src/session/view/room_creation.rs @@ -171,7 +171,7 @@ impl RoomCreation { obj.close(); }, Err(error) => { - error!("Couldn’t create a new room: {error}"); + error!("Could not create a new room: {error}"); obj.handle_error(error); }, }; diff --git a/src/session/view/sidebar/row.rs b/src/session/view/sidebar/row.rs index fe69b153..3c4796c0 100644 --- a/src/session/view/sidebar/row.rs +++ b/src/session/view/sidebar/row.rs @@ -476,7 +476,7 @@ impl Row { self, gettext( // Translators: Do NOT translate the content between '{' and '}', this is a variable name. - "Failed to move {room} from {previous_category} to {new_category}.", + "Could not move {room} from {previous_category} to {new_category}.", ), @room, previous_category = previous_category.to_string(), @@ -491,7 +491,7 @@ impl Row { toast!( self, // Translators: Do NOT translate the content between '{' and '}', this is a variable name. - gettext("Failed to forget {room}."), + gettext("Could not forget {room}."), @room, ); } diff --git a/src/session_list/mod.rs b/src/session_list/mod.rs index 1439d3b3..70628dec 100644 --- a/src/session_list/mod.rs +++ b/src/session_list/mod.rs @@ -247,11 +247,11 @@ impl SessionList { self.set_state(LoadingState::Ready) } Err(error) => { - error!("Failed to restore previous sessions: {error}"); + error!("Could not restore previous sessions: {error}"); let message = format!( "{}\n\n{}", - gettext("Failed to restore previous sessions"), + gettext("Could not restore previous sessions"), error.to_user_facing(), ); @@ -270,7 +270,7 @@ impl SessionList { self.insert(session); } Err(error) => { - warn!("Failed to restore previous session: {error}"); + warn!("Could not restore previous session: {error}"); self.insert(FailedSession::new(session_info, error)); } } diff --git a/src/session_list/session_list_settings.rs b/src/session_list/session_list_settings.rs index da595199..518763d4 100644 --- a/src/session_list/session_list_settings.rs +++ b/src/session_list/session_list_settings.rs @@ -48,7 +48,7 @@ impl SessionListSettings { Ok(stored_sessions) => stored_sessions, Err(error) => { error!( - "Failed to load sessions settings, fallback to default settings: {error}" + "Could not load sessions settings, fallback to default settings: {error}" ); Default::default() } @@ -79,7 +79,7 @@ impl SessionListSettings { "sessions", &serde_json::to_string(&stored_sessions).unwrap(), ) { - error!("Failed to save sessions settings: {error}"); + error!("Could not save sessions settings: {error}"); } } diff --git a/src/system_settings/linux.rs b/src/system_settings/linux.rs index ab4f8bc3..16994bbd 100644 --- a/src/system_settings/linux.rs +++ b/src/system_settings/linux.rs @@ -57,7 +57,7 @@ impl LinuxSystemSettings { { Ok(proxy) => proxy, Err(error) => { - error!("Failed to access settings portal: {error}"); + error!("Could not access settings portal: {error}"); return; } }; @@ -76,7 +76,7 @@ impl LinuxSystemSettings { .upcast_ref::() .set_clock_format(clock_format), Err(error) => { - error!("Failed to access clock format system setting: {error}"); + error!("Could not access clock format system setting: {error}"); return; } }; @@ -94,7 +94,7 @@ impl LinuxSystemSettings { { Ok(stream) => stream, Err(error) => { - error!("Failed to listen to changes of the clock format system setting: {error}"); + error!("Could not listen to changes of the clock format system setting: {error}"); return; } }; diff --git a/src/system_settings/mod.rs b/src/system_settings/mod.rs index 15e64b80..e2c5e56f 100644 --- a/src/system_settings/mod.rs +++ b/src/system_settings/mod.rs @@ -25,7 +25,7 @@ impl Default for ClockFormat { Ok(s) if s.ends_with("am") || s.ends_with("pm") => ClockFormat::TwelveHours, Ok(_) => ClockFormat::TwentyFourHours, Err(error) => { - error!("Failed to get local formatted time: {error}"); + error!("Could not get local formatted time: {error}"); ClockFormat::TwelveHours } } diff --git a/src/user_facing_error.rs b/src/user_facing_error.rs index 19a00a93..0f637643 100644 --- a/src/user_facing_error.rs +++ b/src/user_facing_error.rs @@ -24,7 +24,7 @@ impl UserFacingError for HttpError { if error.is_timeout() { gettext("The connection timed out. Try again later.") } else { - gettext("Unable to connect to the homeserver.") + gettext("Could not connect to the homeserver.") } } HttpError::Api(FromHttpResponseError::Server(RumaApiError::ClientApi( diff --git a/src/utils/location/linux.rs b/src/utils/location/linux.rs index 7c46c1b1..2620f273 100644 --- a/src/utils/location/linux.rs +++ b/src/utils/location/linux.rs @@ -46,7 +46,7 @@ mod imp { if let Some(proxy) = self.proxy.get().cloned() { spawn_tokio!(async move { if let Err(error) = proxy.1.close().await { - error!("Failed to close session of location API: {error}"); + error!("Could not close session of location API: {error}"); } }); } @@ -62,7 +62,7 @@ mod imp { match self.init().await { Ok(()) => Ok(()), Err(error) => { - error!("Failed to initialize location API: {error}"); + error!("Could not initialize location API: {error}"); Err(error.into()) } } @@ -78,7 +78,7 @@ mod imp { .expect("Got invalid coordinates from location API") })), Err(error) => { - error!("Failed to access update stream of location API: {error}"); + error!("Could not access update stream of location API: {error}"); Err(error.into()) } } diff --git a/src/verification_view/identity_verification_view/accept_request_page.rs b/src/verification_view/identity_verification_view/accept_request_page.rs index 7d81a96f..7192ffd8 100644 --- a/src/verification_view/identity_verification_view/accept_request_page.rs +++ b/src/verification_view/identity_verification_view/accept_request_page.rs @@ -158,7 +158,7 @@ impl AcceptRequestPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to decline verification request")); + toast!(obj, gettext("Could not decline verification request")); obj.reset(); } })); @@ -175,7 +175,7 @@ impl AcceptRequestPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.accept().await.is_err() { - toast!(obj, gettext("Failed to accept verification request")); + toast!(obj, gettext("Could not accept verification request")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/cancelled_page.rs b/src/verification_view/identity_verification_view/cancelled_page.rs index 919dce47..7900609a 100644 --- a/src/verification_view/identity_verification_view/cancelled_page.rs +++ b/src/verification_view/identity_verification_view/cancelled_page.rs @@ -185,7 +185,7 @@ impl CancelledPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.restart().await.is_err() { - toast!(obj, gettext("Failed to send a new verification request")); + toast!(obj, gettext("Could not send a new verification request")); obj.reset() } })); diff --git a/src/verification_view/identity_verification_view/choose_method_page.rs b/src/verification_view/identity_verification_view/choose_method_page.rs index 08576591..6d32f183 100644 --- a/src/verification_view/identity_verification_view/choose_method_page.rs +++ b/src/verification_view/identity_verification_view/choose_method_page.rs @@ -228,7 +228,7 @@ impl ChooseMethodPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.start_qr_code_scan().await.is_err() { - toast!(obj, gettext("Failed to access camera")); + toast!(obj, gettext("Could not access camera")); obj.reset(); } })); @@ -247,7 +247,7 @@ impl ChooseMethodPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.start_sas().await.is_err() { - toast!(obj, gettext("Failed to start emoji verification")); + toast!(obj, gettext("Could not start emoji verification")); obj.reset(); } })); @@ -265,7 +265,7 @@ impl ChooseMethodPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to cancel the verification")); + toast!(obj, gettext("Could not cancel the verification")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/confirm_qr_code_page.rs b/src/verification_view/identity_verification_view/confirm_qr_code_page.rs index 5ed3e8be..2ddde323 100644 --- a/src/verification_view/identity_verification_view/confirm_qr_code_page.rs +++ b/src/verification_view/identity_verification_view/confirm_qr_code_page.rs @@ -158,7 +158,7 @@ impl ConfirmQrCodePage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.confirm_qr_code_scanned().await.is_err() { - toast!(obj, gettext("Failed to confirm the scan of the QR Code")); + toast!(obj, gettext("Could not confirm the scan of the QR Code")); obj.reset(); } })); @@ -176,7 +176,7 @@ impl ConfirmQrCodePage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to cancel the verification")); + toast!(obj, gettext("Could not cancel the verification")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/no_supported_methods_page.rs b/src/verification_view/identity_verification_view/no_supported_methods_page.rs index fa8e2590..04a083e0 100644 --- a/src/verification_view/identity_verification_view/no_supported_methods_page.rs +++ b/src/verification_view/identity_verification_view/no_supported_methods_page.rs @@ -185,7 +185,7 @@ impl NoSupportedMethodsPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to decline the verification")); + toast!(obj, gettext("Could not decline the verification")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/qr_code_scanned_page.rs b/src/verification_view/identity_verification_view/qr_code_scanned_page.rs index 29079951..db7e4487 100644 --- a/src/verification_view/identity_verification_view/qr_code_scanned_page.rs +++ b/src/verification_view/identity_verification_view/qr_code_scanned_page.rs @@ -142,7 +142,7 @@ impl QrCodeScannedPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to cancel the verification")); + toast!(obj, gettext("Could not cancel the verification")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/sas_page.rs b/src/verification_view/identity_verification_view/sas_page.rs index 1dc3f442..15fe1637 100644 --- a/src/verification_view/identity_verification_view/sas_page.rs +++ b/src/verification_view/identity_verification_view/sas_page.rs @@ -249,7 +249,7 @@ impl SasPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.sas_mismatch().await.is_err() { - toast!(obj, gettext("Failed to send that the data does not match")); + toast!(obj, gettext("Could not send that the data does not match")); obj.reset_buttons(); } })); @@ -266,7 +266,7 @@ impl SasPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.sas_match().await.is_err() { - toast!(obj, gettext("Failed to send confirmation that the data matches")); + toast!(obj, gettext("Could not send confirmation that the data matches")); obj.reset_buttons(); } })); diff --git a/src/verification_view/identity_verification_view/scan_qr_code_page.rs b/src/verification_view/identity_verification_view/scan_qr_code_page.rs index b21e2075..d438e031 100644 --- a/src/verification_view/identity_verification_view/scan_qr_code_page.rs +++ b/src/verification_view/identity_verification_view/scan_qr_code_page.rs @@ -211,7 +211,7 @@ impl ScanQrCodePage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.qr_code_scanned(data).await.is_err() { - toast!(obj, gettext("Failed to validate scanned QR Code")); + toast!(obj, gettext("Could not validate scanned QR Code")); } })); } @@ -239,7 +239,7 @@ impl ScanQrCodePage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.start_sas().await.is_err() { - toast!(obj, gettext("Failed to start emoji verification")); + toast!(obj, gettext("Could not start emoji verification")); obj.reset(); } })); @@ -257,7 +257,7 @@ impl ScanQrCodePage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to cancel the verification")); + toast!(obj, gettext("Could not cancel the verification")); obj.reset(); } })); diff --git a/src/verification_view/identity_verification_view/wait_for_other_page.rs b/src/verification_view/identity_verification_view/wait_for_other_page.rs index 40f91710..e42b276a 100644 --- a/src/verification_view/identity_verification_view/wait_for_other_page.rs +++ b/src/verification_view/identity_verification_view/wait_for_other_page.rs @@ -157,7 +157,7 @@ impl WaitForOtherPage { spawn!(clone!(@weak self as obj, @weak verification => async move { if verification.cancel().await.is_err() { - toast!(obj, gettext("Failed to cancel the verification")); + toast!(obj, gettext("Could not cancel the verification")); obj.reset(); } })); diff --git a/src/verification_view/session_verification_view.rs b/src/verification_view/session_verification_view.rs index 4d861090..e52bc32c 100644 --- a/src/verification_view/session_verification_view.rs +++ b/src/verification_view/session_verification_view.rs @@ -178,7 +178,7 @@ mod imp { false } Err(error) => { - error!("Failed to get encryption user identity: {error}"); + error!("Could not get encryption user identity: {error}"); false } }; @@ -197,7 +197,7 @@ mod imp { let has_sessions = match devices_handle.await.unwrap() { Ok(devices) => devices.devices().any(|d| d.is_cross_signed_by_owner()), Err(error) => { - error!("Failed to get user devices: {error}"); + error!("Could not get user devices: {error}"); // If there are actually no other devices, the user can still // reset the cross-signing identity. true @@ -425,13 +425,13 @@ impl SessionVerificationView { let error_message = match result { Ok(_) => None, Err(AuthError::UserCancelled) => { - error!("Failed to bootstrap cross-signing: User cancelled the authentication"); + error!("Could not bootstrap cross-signing: User cancelled the authentication"); Some(gettext( "You cancelled the authentication needed to create the encryption identity.", )) } Err(error) => { - error!("Failed to bootstrap cross-signing: {error:?}"); + error!("Could not bootstrap cross-signing: {error:?}"); Some(gettext( "An error occurred during the creation of the encryption identity.", )) @@ -462,7 +462,7 @@ impl SessionVerificationView { obj.show_verification(); } Err(()) => { - toast!(obj, gettext("Failed to send a new verification request")); + toast!(obj, gettext("Could not send a new verification request")); obj.reset(); } } diff --git a/src/window.rs b/src/window.rs index fb4c0a5d..5818608c 100644 --- a/src/window.rs +++ b/src/window.rs @@ -233,10 +233,10 @@ mod imp { // save window state on delete event fn close_request(&self) -> glib::Propagation { if let Err(error) = self.save_window_size() { - warn!("Failed to save window state: {error}"); + warn!("Could not save window state: {error}"); } if let Err(error) = self.save_current_visible_session() { - warn!("Failed to save current session: {error}"); + warn!("Could not save current session: {error}"); } glib::Propagation::Proceed