feat(client): add RU/EN localization and native capture preview
This commit is contained in:
parent
8e5ab56611
commit
8460fb28fd
43 changed files with 4103 additions and 275 deletions
|
|
@ -22,7 +22,7 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
};
|
||||
state.ui.private_mode = private_mode;
|
||||
if restored {
|
||||
state.ui.status_msg = Some("reconnected".into());
|
||||
state.ui.status_msg = Some("Reconnected".into());
|
||||
let text_channel = state.ui.active_channel.clone();
|
||||
let voice_channel = state.ui.voice_target.clone();
|
||||
let net = state.net.clone();
|
||||
|
|
@ -51,7 +51,10 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
state.voice_channel = None;
|
||||
state.last_pipeline_config = None;
|
||||
if will_retry {
|
||||
state.ui.status_msg = Some(format!("connection lost: {reason}"));
|
||||
state.ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Connection lost: {reason}",
|
||||
vec![("reason", reason.to_string())],
|
||||
));
|
||||
} else {
|
||||
state.ui.conn = ConnState::Disconnected;
|
||||
state.ui.voice_target = None;
|
||||
|
|
@ -61,7 +64,10 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
state.ui.active_channel = None;
|
||||
state.ui.user_names.clear();
|
||||
state.ui.rtt_ms = None;
|
||||
state.ui.status_msg = Some(format!("disconnected: {reason}"));
|
||||
state.ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Disconnected: {reason}",
|
||||
vec![("reason", reason.to_string())],
|
||||
));
|
||||
}
|
||||
if !will_retry {
|
||||
state.ui.dm_conversations.clear();
|
||||
|
|
@ -80,8 +86,13 @@ pub fn process_net_events(state: &mut AppState) {
|
|||
state.voice_channel = None;
|
||||
state.last_pipeline_config = None;
|
||||
state.ui.conn = ConnState::Reconnecting { attempt };
|
||||
state.ui.status_msg =
|
||||
Some(format!("reconnecting in {delay_secs}s (attempt {attempt})"));
|
||||
state.ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Reconnecting in {delay_secs}s (attempt {attempt})",
|
||||
vec![
|
||||
("delay_secs", delay_secs.to_string()),
|
||||
("attempt", attempt.to_string()),
|
||||
],
|
||||
));
|
||||
}
|
||||
NetEvent::VoicePacket {
|
||||
channel_id,
|
||||
|
|
@ -521,7 +532,10 @@ fn chat_handle(ui: &mut UiState, net: &NetHandle, event: NetEvent) {
|
|||
ui.scroll_bottom = true;
|
||||
}
|
||||
NetEvent::Error { message, .. } => {
|
||||
ui.status_msg = Some(format!("error: {message}"));
|
||||
ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Server error: {message}",
|
||||
vec![("message", message.to_string())],
|
||||
));
|
||||
}
|
||||
NetEvent::ReactionAdded {
|
||||
channel_id,
|
||||
|
|
@ -810,7 +824,10 @@ pub fn start_voice(state: &mut AppState, channel_id: &str) {
|
|||
state.voice_channel = None;
|
||||
state.last_pipeline_config = Some(cfg);
|
||||
state.ui.voice = VoiceUiState::Error(e.to_string());
|
||||
state.ui.status_msg = Some(format!("microphone error: {e}"));
|
||||
state.ui.status_msg = Some(crate::ui::i18n::Message::with(
|
||||
"Microphone error: {e}",
|
||||
vec![("e", e.to_string())],
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue