diff --git a/Cargo.lock b/Cargo.lock index 3d72258b..449eb550 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -545,9 +545,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.34" +version = "2.0.0-dev.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aacad3a820c302fd81c2842ee70ab6f6c61526c39c449e490c6cbe2023ec802" +checksum = "34014207992d96657886c50c90ab503bb4581cc9c2b1ea7ffad2ec12400032da" dependencies = [ "allo-isolate", "android_logger", @@ -572,9 +572,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.34" +version = "2.0.0-dev.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5dd5e1d22e85c8978199ebabaeaf66cf452bb3a8f5cb9dcc2c8e14a576ca287" +checksum = "fd250246955bb9548a99733859946a5721289ec152de5fcc6eb03da7d3143dd1" dependencies = [ "hex", "quote", diff --git a/app/pubspec.lock b/app/pubspec.lock index 62bef65b..62b2e700 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -336,4 +336,4 @@ packages: version: "3.0.3" sdks: dart: ">=3.3.4 <4.0.0" - flutter: ">=3.16.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/app/rust/Cargo.toml b/app/rust/Cargo.toml index c15fe9f4..394ae087 100644 --- a/app/rust/Cargo.toml +++ b/app/rust/Cargo.toml @@ -9,5 +9,5 @@ crate-type = ["cdylib", "staticlib"] [dependencies] openssl = { version = "0.10", features = ["vendored"] } first_aid_bot_core = { path = "../../core" } -flutter_rust_bridge = "=2.0.0-dev.34" +flutter_rust_bridge = "=2.0.0-dev.32" anyhow = { workspace = true } diff --git a/bot/src/bot/dialogue/logic/broadcast.rs b/bot/src/bot/dialogue/logic/broadcast.rs index be4c225b..5108d591 100644 --- a/bot/src/bot/dialogue/logic/broadcast.rs +++ b/bot/src/bot/dialogue/logic/broadcast.rs @@ -78,7 +78,7 @@ async fn broadcast_if_confirmed( async fn ask_to_confirm(bot: &FABot, id: ChatId, text: &str, dialogue: &FADialogue) -> Result<()> { bot.send_message(id, "Your message is:").await?; let vec = vec![MSG_CONFIRM]; - let keyboard = make_keyboard(&vec, Lang::Ua, 42, true); + let keyboard = make_keyboard(&vec, Lang::En, 42, true); bot.send_message(id, text).reply_markup(keyboard).await?; let message = Some(text.to_string()); dialogue.update(State::Broadcast { message }).await?; @@ -86,7 +86,7 @@ async fn ask_to_confirm(bot: &FABot, id: ChatId, text: &str, dialogue: &FADialog } async fn wait_for_message(bot: &FABot, id: ChatId) -> Result<()> { - let kbd = make_keyboard(&Vec::new(), Lang::Ua, 42, true); + let kbd = make_keyboard(&Vec::new(), Lang::En, 42, true); bot.send_message(id, MSG_REQUEST).reply_markup(kbd).await?; Ok(()) } diff --git a/core/src/model/lang.rs b/core/src/model/lang.rs index 01c7fd5b..61907c00 100644 --- a/core/src/model/lang.rs +++ b/core/src/model/lang.rs @@ -9,22 +9,23 @@ use std::fmt::Display; #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default)] pub enum Lang { + // Ua, #[default] - Ua, - /* En, - Ru, */ + En, + // Ru } impl Lang { // https://github.com/rust-lang/rfcs/issues/284 pub fn iter() -> impl Iterator { - [Lang::Ua /* En, Ru */].into_iter() + // [Lang::Ua].into_iter() + [Lang::En].into_iter() } pub const fn details(self) -> LangDetails { match self { - Lang::Ua => UA_LD, - /* En => EN_LD, - Ru => RU_LD, */ + // Lang::Ua => UA_LD, + Lang::En => EN_LD, + // Lang::Ru => RU_LD, } } pub fn name(self) -> String { @@ -69,33 +70,43 @@ pub struct LangDetails { pub broadcast: &'static str, } -const UA_LD: LangDetails = LangDetails { - name: "Ukrainian", - button_lang: "Українська", - button_back: "◀️ Повернутись", - button_home: "◀️ На початок", +// const UA_LD: LangDetails = LangDetails { +// name: "Ukrainian", +// button_lang: "Українська", +// button_back: "◀️ Повернутись", +// button_home: "◀️ На початок", +// error: concatcp!( +// "Сталась помилка :( Перезапустіть бота (/start), і якщо це не допоможе, будь ласка, повідомте про це у ", +// HELP_CHAT_URL +// ), +// error_due_to_update: concatcp!( +// "Схоже, що бота було оновлено. Повертаюсь на початок. Якщо бот далі не працює, будь ласка, повідомте про це у ", +// HELP_CHAT_URL +// ), +// use_buttons_text: "Використайте кнопки, або перезавантажте бота \\(/start\\)", +// // TODO: Change it <26-06-22, astadnik> // +// greeting: "Що трапилось?", +// broadcast: "Транслювати", +// }; + +const EN_LD: LangDetails = LangDetails { + name: "English", + button_lang: "English", + button_back: "◀️ Back", + button_home: "◀️ Home", error: concatcp!( - "Сталась помилка :( Перезапустіть бота (/start), і якщо це не допоможе, будь ласка, повідомте про це у ", + "An error occurred :( Restart the bot (/start), and if that doesn't help, please report it in ", HELP_CHAT_URL ), error_due_to_update: concatcp!( - "Схоже, що бота було оновлено. Повертаюсь на початок. Якщо бот далі не працює, будь ласка, повідомте про це у ", + "It seems that the bot has been updated. Returning to the beginning. If the bot still doesn't work, please report it in ", HELP_CHAT_URL ), - use_buttons_text: "Використайте кнопки, або перезавантажте бота \\(/start\\)", - // TODO: Change it <26-06-22, astadnik> // - greeting: "Що трапилось?", - broadcast: "Транслювати", + use_buttons_text: "Use buttons, or restart bot if something is wrong (/start)", + greeting: "What happened?", + broadcast: "Broadcast", }; -// const EN_LD: LangDetails = LangDetails { -// name: "English", -// button_lang_name: "English", -// error: "An error occured, please tell us about it at " + HELP_CHAT_URL, -// use_buttons_text: "Use buttons, or restart bot i\f something is wrong (/start)", -// greeting: "What happened?", -// }; - // const RU_LD: LangDetails = LangDetails { // name: "Russian", // button_lang_name: "Русский",