[fractal/fractal-next] Fix format! in gettext occurences



commit 9bcb0a5d1bb03c8da3d8520ca7af3449ec105a70
Author: Kai A. Hiller <V02460 gmail com>
Date:   Sat Aug 14 22:17:36 2021 +0200

    Fix format! in gettext occurences

 src/login.rs             | 5 +----
 src/session/room/room.rs | 6 +++++-
 src/session/room_list.rs | 4 +++-
 3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/login.rs b/src/login.rs
index 85900483..8d05e074 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -229,10 +229,7 @@ impl fmt::Display for LoginError {
             LoginError::UserDeactivated => gettext("⚠️ The user is deactivated."),
             LoginError::LimitExceeded(retry_ms) => {
                 if let Some(ms) = retry_ms {
-                    gettext(format!(
-                        "⚠️ Exceeded rate limit, retry in {} seconds.",
-                        ms.as_secs()
-                    ))
+                    gettext!("⚠️ Exceeded rate limit, retry in {} seconds.", ms.as_secs())
                 } else {
                     gettext("⚠️ Exceeded rate limit, try again later.")
                 }
diff --git a/src/session/room/room.rs b/src/session/room/room.rs
index 346db85b..ba9f47c1 100644
--- a/src/session/room/room.rs
+++ b/src/session/room/room.rs
@@ -368,7 +368,11 @@ impl Room {
                                 let error = Error::new(
                                         error,
                                         clone!(@weak obj => @default-return None, move |_| {
-                                                let error_message = gettext(format!("Failed to move <widget> 
from {} to {}.", previous_category.to_string(), category.to_string()));
+                                                let error_message = gettext!(
+                                                    "Failed to move <widget> from {} to {}.",
+                                                    previous_category.to_string(),
+                                                    category.to_string()
+                                                );
                                                 let room_pill = Pill::new();
                                                 room_pill.set_room(Some(obj.clone()));
                                                 let label = LabelWithWidgets::new(&error_message, 
vec![room_pill]);
diff --git a/src/session/room_list.rs b/src/session/room_list.rs
index 3178b6e4..faf213d2 100644
--- a/src/session/room_list.rs
+++ b/src/session/room_list.rs
@@ -335,7 +335,9 @@ impl RoomList {
                         let error = Error::new(
                             error,
                             clone!(@strong obj => move |_| {
-                                    let error_message = gettext(format!("Failed to join room {}. Try again 
later.", identifier));
+                                    let error_message = gettext!(
+                                        "Failed to join room {}. Try again later.", identifier
+                                    );
                                     let error_label = 
gtk::LabelBuilder::new().label(&error_message).wrap(true).build();
                                     Some(error_label.upcast())
                             }),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]