From 25c7169991d4157888bcb9c245aea784645ed8c0 Mon Sep 17 00:00:00 2001 From: Maxicarlos08 Date: Tue, 16 Jan 2024 17:11:05 +0100 Subject: [PATCH] Renamed share_with_server -> send_to_server requested by @juliancoffee --- assets/voxygen/i18n/en/hud/settings.ftl | 2 +- voxygen/src/hud/settings_window/language.rs | 24 ++++++++++----------- voxygen/src/menu/main/mod.rs | 4 ++-- voxygen/src/session/settings_change.rs | 6 +++--- voxygen/src/settings/language.rs | 6 ++++-- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/assets/voxygen/i18n/en/hud/settings.ftl b/assets/voxygen/i18n/en/hud/settings.ftl index c3c295b1ee..b61b457e7d 100644 --- a/assets/voxygen/i18n/en/hud/settings.ftl +++ b/assets/voxygen/i18n/en/hud/settings.ftl @@ -137,7 +137,7 @@ hud-settings-music_spacing = Music Spacing hud-settings-audio_device = Audio Device hud-settings-reset_sound = Reset to Defaults hud-settings-english_fallback = Display English for missing translations -hud-settings-language_share_with_server = Share configured language with servers (for localizing rules and motd) +hud-settings-language_send_to_server = Send the configured language to servers (for localizing rules and motd messages) hud-settings-awaitingkey = Press a key... hud-settings-unbound = None hud-settings-reset_keybinds = Reset to Defaults diff --git a/voxygen/src/hud/settings_window/language.rs b/voxygen/src/hud/settings_window/language.rs index c942c0fa10..cc6589104d 100644 --- a/voxygen/src/hud/settings_window/language.rs +++ b/voxygen/src/hud/settings_window/language.rs @@ -17,8 +17,8 @@ widget_ids! { window_r, english_fallback_button, english_fallback_button_label, - share_with_server_checkbox, - share_with_server_checkbox_label, + send_to_server_checkbox, + send_to_server_checkbox_label, window_scrollbar, language_list[], } @@ -89,8 +89,8 @@ impl<'a> Widget for Language<'a> { .set(state.ids.window_scrollbar, ui); // Share with server button - let share_with_server = ToggleButton::new( - self.global_state.settings.language.share_with_server, + let send_to_server = ToggleButton::new( + self.global_state.settings.language.send_to_server, self.imgs.checkbox, self.imgs.checkbox_checked, ) @@ -98,23 +98,23 @@ impl<'a> Widget for Language<'a> { .top_left_with_margin_on(state.ids.window, 20.0) .hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo) .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) - .set(state.ids.share_with_server_checkbox, ui); + .set(state.ids.send_to_server_checkbox, ui); - if share_with_server != self.global_state.settings.language.share_with_server { - events.push(ToggleShareWithServer(share_with_server)); + if send_to_server != self.global_state.settings.language.send_to_server { + events.push(ToggleSendToServer(send_to_server)); } Text::new( &self .localized_strings - .get_msg("hud-settings-language_share_with_server"), + .get_msg("hud-settings-language_send_to_server"), ) - .right_from(state.ids.share_with_server_checkbox, 10.0) + .right_from(state.ids.send_to_server_checkbox, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) - .graphics_for(state.ids.share_with_server_checkbox) + .graphics_for(state.ids.send_to_server_checkbox) .color(TEXT_COLOR) - .set(state.ids.share_with_server_checkbox_label, ui); + .set(state.ids.send_to_server_checkbox_label, ui); // English as fallback language let show_english_fallback = ToggleButton::new( @@ -123,7 +123,7 @@ impl<'a> Widget for Language<'a> { self.imgs.checkbox_checked, ) .w_h(18.0, 18.0) - .down_from(state.ids.share_with_server_checkbox, 10.0) + .down_from(state.ids.send_to_server_checkbox, 10.0) .hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo) .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) .set(state.ids.english_fallback_button, ui); diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 6f3c99de0e..ae728db74d 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -125,7 +125,7 @@ impl PlayState for MainMenuState { ConnectionArgs::Mpsc(14004), &mut self.init, &global_state.tokio_runtime, - global_state.settings.language.share_with_server.then_some( + global_state.settings.language.send_to_server.then_some( global_state.settings.language.selected_language.clone(), ), &global_state.i18n, @@ -365,7 +365,7 @@ impl PlayState for MainMenuState { global_state .settings .language - .share_with_server + .send_to_server .then_some(global_state.settings.language.selected_language.clone()), &global_state.i18n, ); diff --git a/voxygen/src/session/settings_change.rs b/voxygen/src/session/settings_change.rs index fa37d51d67..a4be0be0d8 100644 --- a/voxygen/src/session/settings_change.rs +++ b/voxygen/src/session/settings_change.rs @@ -161,7 +161,7 @@ pub enum Interface { #[derive(Clone)] pub enum Language { ChangeLanguage(Box), - ToggleShareWithServer(bool), + ToggleSendToServer(bool), ToggleEnglishFallback(bool), } #[derive(Clone)] @@ -718,8 +718,8 @@ impl SettingsChange { .i18n .set_english_fallback(settings.language.use_english_fallback); }, - Language::ToggleShareWithServer(share) => { - settings.language.share_with_server = share; + Language::ToggleSendToServer(share) => { + settings.language.send_to_server = share; }, }, SettingsChange::Networking(networking_change) => match networking_change { diff --git a/voxygen/src/settings/language.rs b/voxygen/src/settings/language.rs index 0f062c9e03..5a18fc73f1 100644 --- a/voxygen/src/settings/language.rs +++ b/voxygen/src/settings/language.rs @@ -5,7 +5,9 @@ use serde::{Deserialize, Serialize}; pub struct LanguageSettings { pub selected_language: String, #[serde(default = "default_true")] - pub share_with_server: bool, + /// Controls whether the locale is sent to servers we connect (usually for + /// localizing rules & motd messages) + pub send_to_server: bool, pub use_english_fallback: bool, } @@ -13,7 +15,7 @@ impl Default for LanguageSettings { fn default() -> Self { Self { selected_language: i18n::REFERENCE_LANG.to_string(), - share_with_server: true, + send_to_server: true, use_english_fallback: true, } }