From cf093483068f96cb63955c6f683aa08bd59dbae9 Mon Sep 17 00:00:00 2001 From: parzivale <40600864+parzivale@users.noreply.github.com> Date: Tue, 23 Aug 2022 13:14:29 +0200 Subject: [PATCH] second cleaning pass after removing i18n.get --- voxygen/src/hud/buffs.rs | 4 +- voxygen/src/hud/buttons.rs | 14 +-- voxygen/src/hud/chat.rs | 4 +- voxygen/src/hud/crafting.rs | 86 +++++++------- voxygen/src/hud/esc_menu.rs | 12 +- voxygen/src/hud/group.rs | 18 +-- voxygen/src/hud/mod.rs | 92 +++++++-------- voxygen/src/hud/overitem.rs | 6 +- voxygen/src/hud/settings_window/chat.rs | 44 +++---- voxygen/src/hud/settings_window/controls.rs | 8 +- voxygen/src/hud/settings_window/gameplay.rs | 32 ++--- voxygen/src/hud/settings_window/interface.rs | 68 +++++------ voxygen/src/hud/settings_window/language.rs | 2 +- voxygen/src/hud/settings_window/mod.rs | 36 +++--- voxygen/src/hud/settings_window/networking.rs | 10 +- voxygen/src/hud/settings_window/sound.rs | 14 +-- voxygen/src/hud/settings_window/video.rs | 110 +++++++++--------- voxygen/src/hud/skillbar.rs | 8 +- voxygen/src/hud/social.rs | 12 +- voxygen/src/hud/trade.rs | 20 ++-- voxygen/src/menu/char_selection/mod.rs | 4 +- voxygen/src/menu/main/mod.rs | 50 ++++---- voxygen/src/session/mod.rs | 4 +- voxygen/src/ui/widgets/item_tooltip.rs | 4 +- 24 files changed, 331 insertions(+), 331 deletions(-) diff --git a/voxygen/src/hud/buffs.rs b/voxygen/src/hud/buffs.rs index 4752d57fd3..0ae50468b7 100644 --- a/voxygen/src/hud/buffs.rs +++ b/voxygen/src/hud/buffs.rs @@ -230,7 +230,7 @@ impl<'a> Widget for BuffsBar<'a> { let title = hud::get_buff_title(buff.kind, localized_strings); let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings); let remaining_time = hud::get_buff_time(*buff); - let click_to_remove = format!("<{}>", &localized_strings.get("buff.remove")); + let click_to_remove = format!("<{}>", &localized_strings.get_msg("buff-remove")); let desc = format!("{}\n\n{}\n\n{}", desc_txt, remaining_time, click_to_remove); // Timer overlay if Button::image(self.get_duration_image(duration_percentage)) @@ -388,7 +388,7 @@ impl<'a> Widget for BuffsBar<'a> { let title = hud::get_buff_title(buff.kind, localized_strings); let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings); let remaining_time = hud::get_buff_time(*buff); - let click_to_remove = format!("<{}>", &localized_strings.get("buff.remove")); + let click_to_remove = format!("<{}>", &localized_strings.get_msg("buff-remove")); let desc = if buff.is_buff { format!("{}\n\n{}", desc_txt, click_to_remove) } else { diff --git a/voxygen/src/hud/buttons.rs b/voxygen/src/hud/buttons.rs index 2e14c09ba0..61ce7abc2d 100644 --- a/voxygen/src/hud/buttons.rs +++ b/voxygen/src/hud/buttons.rs @@ -231,7 +231,7 @@ impl<'a> Widget for Buttons<'a> { .press_image(self.imgs.settings_press) .with_tooltip( self.tooltip_manager, - &localized_strings.get("common.settings"), + &localized_strings.get_msg("common-settings"), "", &button_tooltip, TEXT_COLOR, @@ -264,7 +264,7 @@ impl<'a> Widget for Buttons<'a> { .press_image(self.imgs.social_press) .with_tooltip( self.tooltip_manager, - &localized_strings.get("hud.social"), + &localized_strings.get_msg("hud-social"), "", &button_tooltip, TEXT_COLOR, @@ -296,7 +296,7 @@ impl<'a> Widget for Buttons<'a> { .press_image(self.imgs.map_press) .with_tooltip( self.tooltip_manager, - &localized_strings.get("hud.map.map_title"), + &localized_strings.get_msg("hud-map-map_title"), "", &button_tooltip, TEXT_COLOR, @@ -333,7 +333,7 @@ impl<'a> Widget for Buttons<'a> { .press_image(self.imgs.spellbook_press) .with_tooltip( self.tooltip_manager, - &localized_strings.get("hud.diary"), + &localized_strings.get_msg("hud-diary"), "", &button_tooltip, TEXT_COLOR, @@ -366,14 +366,14 @@ impl<'a> Widget for Buttons<'a> { .mid_top_with_margin_on(state.ids.spellbook_button, -12.0 + arrow_ani as f64) .color(Some(QUALITY_LEGENDARY)) .set(state.ids.sp_arrow, ui); - Text::new(&localized_strings.get("hud.sp_arrow_txt")) + Text::new(&localized_strings.get_msg("hud-sp_arrow_txt")) .mid_top_with_margin_on(state.ids.sp_arrow, -18.0) .graphics_for(state.ids.spellbook_button) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) .color(BLACK) .set(state.ids.sp_arrow_txt_bg, ui); - Text::new(&localized_strings.get("hud.sp_arrow_txt")) + Text::new(&localized_strings.get_msg("hud-sp_arrow_txt")) .graphics_for(state.ids.spellbook_button) .bottom_right_with_margins_on(state.ids.sp_arrow_txt_bg, 1.0, 1.0) .font_id(self.fonts.cyri.conrod_id) @@ -389,7 +389,7 @@ impl<'a> Widget for Buttons<'a> { .press_image(self.imgs.crafting_icon_press) .with_tooltip( self.tooltip_manager, - &localized_strings.get("hud.crafting"), + &localized_strings.get_msg("hud-crafting"), "", &button_tooltip, TEXT_COLOR, diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index dbdffb21cb..6ec3d2c32b 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -552,7 +552,7 @@ impl<'a> Widget for Chat<'a> { .hover_image(self.imgs.selection_hover) .hover_image(self.imgs.selection_press) .image_color(shading) - .label(&self.localized_strings.get("hud.chat.all")) + .label(&self.localized_strings.get_msg("hud-chat-all")) .label_font_size(self.fonts.cyri.scale(14)) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR.alpha(alpha)) @@ -613,7 +613,7 @@ impl<'a> Widget for Chat<'a> { Text::new( &self .localized_strings - .get("hud.chat.chat_tab_hover_tooltip"), + .get_msg("hud-chat-chat_tab_hover_tooltip"), ) .mid_top_with_margin_on(state.ids.chat_tab_tooltip_bg, 3.0) .font_size(self.fonts.cyri.scale(10)) diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index c8c91e01e7..6bf71316b4 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -213,17 +213,17 @@ pub enum CraftingTab { impl CraftingTab { fn name_key(self) -> &'static str { match self { - CraftingTab::All => "hud.crafting.tabs.all", - CraftingTab::Armor => "hud.crafting.tabs.armor", - CraftingTab::Food => "hud.crafting.tabs.food", - CraftingTab::Glider => "hud.crafting.tabs.glider", - CraftingTab::Potion => "hud.crafting.tabs.potion", - CraftingTab::Tool => "hud.crafting.tabs.tool", - CraftingTab::Utility => "hud.crafting.tabs.utility", - CraftingTab::Weapon => "hud.crafting.tabs.weapon", - CraftingTab::Bag => "hud.crafting.tabs.bag", - CraftingTab::ProcessedMaterial => "hud.crafting.tabs.processed_material", - CraftingTab::Dismantle => "hud.crafting.tabs.dismantle", + CraftingTab::All => "hud-crafting-tabs-all", + CraftingTab::Armor => "hud-crafting-tabs-armor", + CraftingTab::Food => "hud-crafting-tabs-food", + CraftingTab::Glider => "hud-crafting-tabs-glider", + CraftingTab::Potion => "hud-crafting-tabs-potion", + CraftingTab::Tool => "hud-crafting-tabs-tool", + CraftingTab::Utility => "hud-crafting-tabs-utility", + CraftingTab::Weapon => "hud-crafting-tabs-weapon", + CraftingTab::Bag => "hud-crafting-tabs-bag", + CraftingTab::ProcessedMaterial => "hud-crafting-tabs-processed_material", + CraftingTab::Dismantle => "hud-crafting-tabs-dismantle", } } @@ -391,7 +391,7 @@ impl<'a> Widget for Crafting<'a> { } // Title - Text::new(&self.localized_strings.get("hud.crafting")) + Text::new(&self.localized_strings.get_msg("hud-crafting")) .mid_top_with_margin_on(state.ids.window_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(20)) @@ -467,7 +467,7 @@ impl<'a> Widget for Crafting<'a> { }) .with_tooltip( self.tooltip_manager, - &self.localized_strings.get(crafting_tab.name_key()), + &self.localized_strings.get_msg(crafting_tab.name_key()), "", &tabs_tooltip, TEXT_COLOR, @@ -961,25 +961,25 @@ impl<'a> Widget for Crafting<'a> { let (tooltip_title, tooltip_desc) = match recipe_kind { RecipeKind::ModularWeapon => ( self.localized_strings - .get("hud.crafting.mod_weap_prim_slot_title"), + .get_msg("hud-crafting-mod_weap_prim_slot_title"), self.localized_strings - .get("hud.crafting.mod_weap_prim_slot_desc"), + .get_msg("hud-crafting-mod_weap_prim_slot_desc"), ), RecipeKind::Component( ToolKind::Sword | ToolKind::Axe | ToolKind::Hammer, ) => ( self.localized_strings - .get("hud.crafting.mod_comp_metal_prim_slot_title"), + .get_msg("hud-crafting-mod_comp_metal_prim_slot_title"), self.localized_strings - .get("hud.crafting.mod_comp_metal_prim_slot_desc"), + .get_msg("hud-crafting-mod_comp_metal_prim_slot_desc"), ), RecipeKind::Component( ToolKind::Bow | ToolKind::Staff | ToolKind::Sceptre, ) => ( self.localized_strings - .get("hud.crafting.mod_comp_wood_prim_slot_title"), + .get_msg("hud-crafting-mod_comp_wood_prim_slot_title"), self.localized_strings - .get("hud.crafting.mod_comp_wood_prim_slot_desc"), + .get_msg("hud-crafting-mod_comp_wood_prim_slot_desc"), ), RecipeKind::Component(_) | RecipeKind::Simple => { (Cow::Borrowed(""), Cow::Borrowed("")) @@ -1050,15 +1050,15 @@ impl<'a> Widget for Crafting<'a> { let (tooltip_title, tooltip_desc) = match recipe_kind { RecipeKind::ModularWeapon => ( self.localized_strings - .get("hud.crafting.mod_weap_sec_slot_title"), + .get_msg("hud-crafting-mod_weap_sec_slot_title"), self.localized_strings - .get("hud.crafting.mod_weap_sec_slot_desc"), + .get_msg("hud-crafting-mod_weap_sec_slot_desc"), ), RecipeKind::Component(_) => ( self.localized_strings - .get("hud.crafting.mod_comp_sec_slot_title"), + .get_msg("hud-crafting-mod_comp_sec_slot_title"), self.localized_strings - .get("hud.crafting.mod_comp_sec_slot_desc"), + .get_msg("hud-crafting-mod_comp_sec_slot_desc"), ), RecipeKind::Simple => (Cow::Borrowed(""), Cow::Borrowed("")), }; @@ -1221,7 +1221,7 @@ impl<'a> Widget for Crafting<'a> { == recipe.craft_sprite, ) } else { - Text::new(&self.localized_strings.get("hud.crafting.modular_desc")) + Text::new(&self.localized_strings.get_msg("hud-crafting-modular_desc")) .mid_top_with_margin_on(state.ids.modular_art, -18.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(13)) @@ -1316,7 +1316,7 @@ impl<'a> Widget for Crafting<'a> { }; icon.with_tooltip( self.tooltip_manager, - &self.localized_strings.get(crafting_tab.name_key()), + &self.localized_strings.get_msg(crafting_tab.name_key()), "", &tabs_tooltip, TEXT_COLOR, @@ -1353,7 +1353,7 @@ impl<'a> Widget for Crafting<'a> { .then_some(self.imgs.button_press) .unwrap_or(self.imgs.button), ) - .label(&self.localized_strings.get("hud.crafting.craft")) + .label(&self.localized_strings.get_msg("hud-crafting-craft")) .label_y(conrod_core::position::Relative::Scalar(1.0)) .label_color(can_perform.then_some(TEXT_COLOR).unwrap_or(TEXT_GRAY_COLOR)) .label_font_size(self.fonts.cyri.scale(12)) @@ -1406,7 +1406,7 @@ impl<'a> Widget for Crafting<'a> { .then_some(self.imgs.button_press) .unwrap_or(self.imgs.button), ) - .label(&self.localized_strings.get("hud.crafting.craft_all")) + .label(&self.localized_strings.get_msg("hud-crafting-craft_all")) .label_y(conrod_core::position::Relative::Scalar(1.0)) .label_color( can_perform_all @@ -1446,7 +1446,7 @@ impl<'a> Widget for Crafting<'a> { Text::new( &self .localized_strings - .get("hud.crafting.req_crafting_station"), + .get_msg("hud-crafting-req_crafting_station"), ) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(18)) @@ -1485,18 +1485,18 @@ impl<'a> Widget for Crafting<'a> { .set(state.ids.req_station_img, ui); let station_name = match recipe.craft_sprite { - Some(SpriteKind::Anvil) => "hud.crafting.anvil", - Some(SpriteKind::Cauldron) => "hud.crafting.cauldron", - Some(SpriteKind::CookingPot) => "hud.crafting.cooking_pot", - Some(SpriteKind::CraftingBench) => "hud.crafting.crafting_bench", - Some(SpriteKind::Forge) => "hud.crafting.forge", - Some(SpriteKind::Loom) => "hud.crafting.loom", - Some(SpriteKind::SpinningWheel) => "hud.crafting.spinning_wheel", - Some(SpriteKind::TanningRack) => "hud.crafting.tanning_rack", - Some(SpriteKind::DismantlingBench) => "hud.crafting.salvaging_station", + Some(SpriteKind::Anvil) => "hud-crafting-anvil", + Some(SpriteKind::Cauldron) => "hud-crafting-cauldron", + Some(SpriteKind::CookingPot) => "hud.crafting-cooking_pot", + Some(SpriteKind::CraftingBench) => "hud-crafting-crafting_bench", + Some(SpriteKind::Forge) => "hud-crafting-forge", + Some(SpriteKind::Loom) => "hud-crafting-loom", + Some(SpriteKind::SpinningWheel) => "hud-crafting-spinning_wheel", + Some(SpriteKind::TanningRack) => "hud-crafting-tanning_rack", + Some(SpriteKind::DismantlingBench) => "hud-crafting-salvaging_station", _ => "", }; - Text::new(&self.localized_strings.get(station_name)) + Text::new(&self.localized_strings.get_msg(station_name)) .right_from(state.ids.req_station_img, 10.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) @@ -1558,7 +1558,7 @@ impl<'a> Widget for Crafting<'a> { let num_ingredients = ingredients.len(); if num_ingredients > 0 { - Text::new(&self.localized_strings.get("hud.crafting.ingredients")) + Text::new(&self.localized_strings.get_msg("hud-crafting-ingredients")) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(18)) .color(TEXT_COLOR) @@ -1754,7 +1754,7 @@ impl<'a> Widget for Crafting<'a> { } else { state.ids.ingredient_frame[i - 1] }; - Text::new(&self.localized_strings.get("hud.crafting.tool_cata")) + Text::new(&self.localized_strings.get_msg("hud-crafting-tool_cata")) .down_from(ref_widget, 20.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) @@ -1804,7 +1804,7 @@ impl<'a> Widget for Crafting<'a> { } } else if *sel_crafting_tab == CraftingTab::Dismantle { // Title - Text::new(&self.localized_strings.get("hud.crafting.dismantle_title")) + Text::new(&self.localized_strings.get_msg("hud-crafting-dismantle_title")) .mid_top_with_margin_on(state.ids.align_ing, 0.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(24)) @@ -1830,7 +1830,7 @@ impl<'a> Widget for Crafting<'a> { Text::new( &self .localized_strings - .get("hud.crafting.dismantle_explanation"), + .get_msg("hud-crafting-dismantle_explanation"), ) .mid_bottom_with_margin_on(state.ids.dismantle_img, -60.0) .font_id(self.fonts.cyri.conrod_id) @@ -1871,7 +1871,7 @@ impl<'a> Widget for Crafting<'a> { events.push(Event::SearchRecipe(Some(string))); } } else { - Text::new(&self.localized_strings.get("hud.crafting.recipes")) + Text::new(&self.localized_strings.get_msg("hud-crafting-recipes")) .mid_top_with_margin_on(state.ids.align_rec, -22.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) diff --git a/voxygen/src/hud/esc_menu.rs b/voxygen/src/hud/esc_menu.rs index a72b432c83..cbb7cfca03 100644 --- a/voxygen/src/hud/esc_menu.rs +++ b/voxygen/src/hud/esc_menu.rs @@ -87,7 +87,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("common.resume")) + .label(&self.localized_strings.get_msg("common-resume")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) @@ -104,7 +104,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("common.settings")) + .label(&self.localized_strings.get_msg("common-settings")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) @@ -120,7 +120,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("common.controls")) + .label(&self.localized_strings.get_msg("common-controls")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) @@ -136,7 +136,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("common.characters")) + .label(&self.localized_strings.get_msg("common-characters")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) @@ -152,7 +152,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("esc_menu.logout")) + .label(&self.localized_strings.get_msg("esc_menu-logout")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) @@ -168,7 +168,7 @@ impl<'a> Widget for EscMenu<'a> { .w_h(210.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("esc_menu.quit_game")) + .label(&self.localized_strings.get_msg("esc_menu-quit_game")) .label_y(conrod_core::position::Relative::Scalar(3.0)) .label_color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(20)) diff --git a/voxygen/src/hud/group.rs b/voxygen/src/hud/group.rs index 51371d6327..b5e041b8b5 100644 --- a/voxygen/src/hud/group.rs +++ b/voxygen/src/hud/group.rs @@ -428,7 +428,7 @@ impl<'a> Widget for Group<'a> { } if health.is_dead { // Death Text - Text::new(&self.localized_strings.get("hud.group.dead")) + Text::new(&self.localized_strings.get_msg("hud-group-dead")) .mid_top_with_margin_on(state.ids.member_panels_bg[i], 1.0) .font_size(20) .font_id(self.fonts.cyri.conrod_id) @@ -611,7 +611,7 @@ impl<'a> Widget for Group<'a> { .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.member_panels_frame[i], ui); // Panel Text - Text::new(&self.localized_strings.get("hud.group.out_of_range")) + Text::new(&self.localized_strings.get_msg("hud-group-out_of_range")) .mid_top_with_margin_on(state.ids.member_panels_bg[i], 3.0) .font_size(16) .font_id(self.fonts.cyri.conrod_id) @@ -630,7 +630,7 @@ impl<'a> Widget for Group<'a> { .press_image(self.imgs.button) .label_color(TEXT_COLOR_GREY) .image_color(TEXT_COLOR_GREY) - .label(&self.localized_strings.get("hud.group.add_friend")) + .label(&self.localized_strings.get_msg("hud-group-add_friend")) .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(self.fonts.cyri.scale(10)) .set(state.ids.btn_friend, ui) @@ -641,7 +641,7 @@ impl<'a> Widget for Group<'a> { .bottom_right_with_margins_on(state.ids.bg, 5.0, 5.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("hud.group.leave")) + .label(&self.localized_strings.get_msg("hud-group-leave")) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(self.fonts.cyri.scale(10)) @@ -659,7 +659,7 @@ impl<'a> Widget for Group<'a> { .mid_bottom_with_margin_on(state.ids.btn_friend, -27.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("hud.group.assign_leader")) + .label(&self.localized_strings.get_msg("hud-group-assign_leader")) .label_color(if state.selected_member.is_some() { TEXT_COLOR } else { @@ -682,7 +682,7 @@ impl<'a> Widget for Group<'a> { .mid_bottom_with_margin_on(state.ids.btn_leader, -27.0) .hover_image(self.imgs.button) .press_image(self.imgs.button) - .label(&self.localized_strings.get("hud.group.link_group")) + .label(&self.localized_strings.get_msg("hud-group-link_group")) .hover_image(self.imgs.button) .press_image(self.imgs.button) .label_color(TEXT_COLOR_GREY) @@ -698,7 +698,7 @@ impl<'a> Widget for Group<'a> { .down_from(state.ids.btn_link, 5.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.localized_strings.get("hud.group.kick")) + .label(&self.localized_strings.get_msg("hud-group-kick")) .label_color(if state.selected_member.is_some() { TEXT_COLOR } else { @@ -826,7 +826,7 @@ impl<'a> Widget for Group<'a> { .label(&format!( "[{}] {}", &accept_key, - self.localized_strings.get("common.accept") + self.localized_strings.get_msg("common-accept") )) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) @@ -851,7 +851,7 @@ impl<'a> Widget for Group<'a> { .label(&format!( "[{}] {}", &decline_key, - self.localized_strings.get("common.decline") + self.localized_strings.get_msg("common-decline") )) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 73891d196b..8ca0832907 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -4584,69 +4584,69 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow { match buff { // Buffs - BuffKind::Regeneration { .. } => localized_strings.get("buff.title.heal"), - BuffKind::Saturation { .. } => localized_strings.get("buff.title.saturation"), - BuffKind::Potion { .. } => localized_strings.get("buff.title.potion"), - BuffKind::CampfireHeal { .. } => localized_strings.get("buff.title.campfire_heal"), - BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.title.IncreaseMaxHealth"), - BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.title.energyup"), - BuffKind::Invulnerability => localized_strings.get("buff.title.invulnerability"), - BuffKind::ProtectingWard => localized_strings.get("buff.title.protectingward"), - BuffKind::Frenzied => localized_strings.get("buff.title.frenzied"), - BuffKind::Hastened => localized_strings.get("buff.title.hastened"), + BuffKind::Regeneration { .. } => localized_strings.get_msg("buff-title-heal"), + BuffKind::Saturation { .. } => localized_strings.get_msg("buff-title-saturation"), + BuffKind::Potion { .. } => localized_strings.get_msg("buff-title-potion"), + BuffKind::CampfireHeal { .. } => localized_strings.get_msg("buff-title-campfire_heal"), + BuffKind::IncreaseMaxHealth { .. } => localized_strings.get_msg("buff-title-IncreaseMaxHealth"), + BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get_msg("buff-title-energyup"), + BuffKind::Invulnerability => localized_strings.get_msg("buff-title-invulnerability"), + BuffKind::ProtectingWard => localized_strings.get_msg("buff-title-protectingward"), + BuffKind::Frenzied => localized_strings.get_msg("buff-title-frenzied"), + BuffKind::Hastened => localized_strings.get_msg("buff-title-hastened"), // Debuffs - BuffKind::Bleeding { .. } => localized_strings.get("buff.title.bleed"), - BuffKind::Cursed { .. } => localized_strings.get("buff.title.cursed"), - BuffKind::Burning { .. } => localized_strings.get("buff.title.burn"), - BuffKind::Crippled { .. } => localized_strings.get("buff.title.crippled"), - BuffKind::Frozen { .. } => localized_strings.get("buff.title.frozen"), - BuffKind::Wet { .. } => localized_strings.get("buff.title.wet"), - BuffKind::Ensnared { .. } => localized_strings.get("buff.title.ensnared"), - BuffKind::Poisoned { .. } => localized_strings.get("buff.title.poisoned"), + BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"), + BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"), + BuffKind::Burning { .. } => localized_strings.get_msg("buff-title-burn"), + BuffKind::Crippled { .. } => localized_strings.get_msg("buff-title-crippled"), + BuffKind::Frozen { .. } => localized_strings.get_msg("buff-title-frozen"), + BuffKind::Wet { .. } => localized_strings.get_msg("buff-title-wet"), + BuffKind::Ensnared { .. } => localized_strings.get_msg("buff-title-ensnared"), + BuffKind::Poisoned { .. } => localized_strings.get_msg("buff-title-poisoned"), } } pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localization) -> Cow { match buff { // Buffs - BuffKind::Regeneration { .. } => localized_strings.get("buff.desc.heal"), - BuffKind::Saturation { .. } => localized_strings.get("buff.desc.saturation"), - BuffKind::Potion { .. } => localized_strings.get("buff.desc.potion"), + BuffKind::Regeneration { .. } => localized_strings.get_msg("buff-desc-heal"), + BuffKind::Saturation { .. } => localized_strings.get_msg("buff-desc-saturation"), + BuffKind::Potion { .. } => localized_strings.get_msg("buff-desc-potion"), BuffKind::CampfireHeal { .. } => { localized_strings.get_msg_ctx("buff-desc-campfire_heal", &i18n::fluent_args! { "rate" => data.strength * 100.0 }) }, - BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.desc.IncreaseMaxHealth"), - BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.desc.IncreaseMaxEnergy"), - BuffKind::Invulnerability => localized_strings.get("buff.desc.invulnerability"), - BuffKind::ProtectingWard => localized_strings.get("buff.desc.protectingward"), - BuffKind::Frenzied => localized_strings.get("buff.desc.frenzied"), - BuffKind::Hastened => localized_strings.get("buff.desc.hastened"), + BuffKind::IncreaseMaxHealth { .. } => localized_strings.get_msg("buff-desc-IncreaseMaxHealth"), + BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get_msg("buff-desc-IncreaseMaxEnergy"), + BuffKind::Invulnerability => localized_strings.get_msg("buff-desc-invulnerability"), + BuffKind::ProtectingWard => localized_strings.get_msg("buff-desc-protectingward"), + BuffKind::Frenzied => localized_strings.get_msg("buff-desc-frenzied"), + BuffKind::Hastened => localized_strings.get_msg("buff-desc-hastened"), // Debuffs - BuffKind::Bleeding { .. } => localized_strings.get("buff.desc.bleed"), - BuffKind::Cursed { .. } => localized_strings.get("buff.desc.cursed"), - BuffKind::Burning { .. } => localized_strings.get("buff.desc.burn"), - BuffKind::Crippled { .. } => localized_strings.get("buff.desc.crippled"), - BuffKind::Frozen { .. } => localized_strings.get("buff.desc.frozen"), - BuffKind::Wet { .. } => localized_strings.get("buff.desc.wet"), - BuffKind::Ensnared { .. } => localized_strings.get("buff.desc.ensnared"), - BuffKind::Poisoned { .. } => localized_strings.get("buff.desc.poisoned"), + BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"), + BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"), + BuffKind::Burning { .. } => localized_strings.get_msg("buff-desc-burn"), + BuffKind::Crippled { .. } => localized_strings.get_msg("buff-desc-crippled"), + BuffKind::Frozen { .. } => localized_strings.get_msg("buff-desc-frozen"), + BuffKind::Wet { .. } => localized_strings.get_msg("buff-desc-wet"), + BuffKind::Ensnared { .. } => localized_strings.get_msg("buff-desc-ensnared"), + BuffKind::Poisoned { .. } => localized_strings.get_msg("buff-desc-poisoned"), } } pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) -> Option> { let i18n_key = match sprite { SpriteKind::Empty => return None, - SpriteKind::Anvil => "hud.crafting.anvil", - SpriteKind::Cauldron => "hud.crafting.cauldron", - SpriteKind::CookingPot => "hud.crafting.cooking_pot", - SpriteKind::CraftingBench => "hud.crafting.crafting_bench", - SpriteKind::Forge => "hud.crafting.forge", - SpriteKind::Loom => "hud.crafting.loom", - SpriteKind::SpinningWheel => "hud.crafting.spinning_wheel", - SpriteKind::TanningRack => "hud.crafting.tanning_rack", - SpriteKind::DismantlingBench => "hud.crafting.salvaging_station", + SpriteKind::Anvil => "hud-crafting-anvil", + SpriteKind::Cauldron => "hud-crafting-cauldron", + SpriteKind::CookingPot => "hud-crafting-cooking_pot", + SpriteKind::CraftingBench => "hud-crafting-crafting_bench", + SpriteKind::Forge => "hud-crafting-forge", + SpriteKind::Loom => "hud-crafting-loom", + SpriteKind::SpinningWheel => "hud-crafting-spinning_wheel", + SpriteKind::TanningRack => "hud-crafting-tanning_rack", + SpriteKind::DismantlingBench => "hud-crafting-salvaging_station", SpriteKind::ChestBuried | SpriteKind::Chest | SpriteKind::DungeonChest0 @@ -4654,10 +4654,10 @@ pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) -> | SpriteKind::DungeonChest2 | SpriteKind::DungeonChest3 | SpriteKind::DungeonChest4 - | SpriteKind::DungeonChest5 => "common.sprite.chest", + | SpriteKind::DungeonChest5 => "common-sprite-chest", sprite => return Some(Cow::Owned(format!("{:?}", sprite))), }; - Some(localized_strings.get(i18n_key)) + Some(localized_strings.get_msg(i18n_key)) } pub fn get_buff_time(buff: BuffInfo) -> String { diff --git a/voxygen/src/hud/overitem.rs b/voxygen/src/hud/overitem.rs index 25f0463a1d..00112ab29b 100644 --- a/voxygen/src/hud/overitem.rs +++ b/voxygen/src/hud/overitem.rs @@ -230,13 +230,13 @@ impl<'a> Widget for Overitem<'a> { let text = match collect_failed_data.reason { HudCollectFailedReason::InventoryFull => { - self.localized_strings.get("hud.inventory_full") + self.localized_strings.get_msg("hud-inventory_full") }, HudCollectFailedReason::LootOwned { owner, expiry_secs } => { let owner_name = match owner { HudLootOwner::Name(name) => Cow::Owned(name), - HudLootOwner::Group => self.localized_strings.get("hud.another_group"), - HudLootOwner::Unknown => self.localized_strings.get("hud.someone_else"), + HudLootOwner::Group => self.localized_strings.get_msg("hud-another_group"), + HudLootOwner::Unknown => self.localized_strings.get_msg("hud-someone_else"), }; self.localized_strings.get_msg_ctx( "hud-owned_by_for_secs", diff --git a/voxygen/src/hud/settings_window/chat.rs b/voxygen/src/hud/settings_window/chat.rs index f03d8c3b69..d57143d6e9 100644 --- a/voxygen/src/hud/settings_window/chat.rs +++ b/voxygen/src/hud/settings_window/chat.rs @@ -141,7 +141,7 @@ impl<'a> Widget for Chat<'a> { .set(state.ids.window_r, ui); // General Title - Text::new(&self.localized_strings.get("hud.settings.general")) + Text::new(&self.localized_strings.get_msg("hud-settings-general")) .top_left_with_margins_on(state.ids.window, 5.0, 5.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -152,7 +152,7 @@ impl<'a> Widget for Chat<'a> { Text::new( &self .localized_strings - .get("hud.settings.background_opacity"), + .get_msg("hud-settings-background_opacity"), ) .down_from(state.ids.general_txt, 20.0) .font_size(self.fonts.cyri.scale(14)) @@ -188,7 +188,7 @@ impl<'a> Widget for Chat<'a> { Text::new( &self .localized_strings - .get("hud.settings.chat_character_name"), + .get_msg("hud-settings-chat_character_name"), ) .down_from(state.ids.transp_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -219,7 +219,7 @@ impl<'a> Widget for Chat<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.char_name_text, 20.0) - .label(&self.localized_strings.get("hud.settings.reset_chat")) + .label(&self.localized_strings.get_msg("hud-settings-reset_chat")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) @@ -231,7 +231,7 @@ impl<'a> Widget for Chat<'a> { } // Tabs Title - Text::new(&self.localized_strings.get("hud.settings.chat_tabs")) + Text::new(&self.localized_strings.get_msg("hud-settings-chat_tabs")) .top_left_with_margins_on(state.ids.window_r, 5.0, 5.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -335,7 +335,7 @@ impl<'a> Widget for Chat<'a> { { let mut updated_chat_tab = chat_tab.clone(); - Text::new(&self.localized_strings.get("hud.settings.label")) + Text::new(&self.localized_strings.get_msg("hud-settings-label")) .top_left_with_margins_on(state.ids.tab_content_align, 5.0, 25.0) .font_size(self.fonts.cyri.scale(16)) .font_id(self.fonts.cyri.conrod_id) @@ -363,7 +363,7 @@ impl<'a> Widget for Chat<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .w_h(100.0, 30.0) - .label(&self.localized_strings.get("hud.settings.delete")) + .label(&self.localized_strings.get_msg("hud-settings-delete")) .label_font_size(self.fonts.cyri.scale(14)) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) @@ -418,7 +418,7 @@ impl<'a> Widget for Chat<'a> { }; //Messages - Text::new(&self.localized_strings.get("hud.settings.messages")) + Text::new(&self.localized_strings.get_msg("hud-settings-messages")) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(16)) .color(TEXT_COLOR) @@ -441,7 +441,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_all = !chat_tab.filter.message_all; }; - Text::new(&self.localized_strings.get("hud.settings.show_all")) + Text::new(&self.localized_strings.get_msg("hud-settings-show_all")) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(16)) .color(TEXT_COLOR) @@ -458,7 +458,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_group = !chat_tab.filter.message_group; } - let group_text = self.localized_strings.get("hud.settings.group"); + let group_text = self.localized_strings.get_msg("hud-settings-group"); create_toggle_text(&group_text, !chat_tab.filter.message_all) .right_from(state.ids.btn_messages_group, 5.0) .set(state.ids.text_messages_group, ui); @@ -480,7 +480,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_faction = !chat_tab.filter.message_faction; } - let faction_text = self.localized_strings.get("hud.settings.faction"); + let faction_text = self.localized_strings.get_msg("hud-settings-faction"); create_toggle_text(&faction_text, !chat_tab.filter.message_all) .right_from(state.ids.btn_messages_faction, 5.0) .set(state.ids.text_messages_faction, ui); @@ -499,7 +499,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_world = !chat_tab.filter.message_world; } - let world_text = self.localized_strings.get("hud.settings.world"); + let world_text = self.localized_strings.get_msg("hud-settings-world"); create_toggle_text(&world_text, !chat_tab.filter.message_all) .right_from(state.ids.btn_messages_world, 5.0) .set(state.ids.text_messages_world, ui); @@ -518,7 +518,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_region = !chat_tab.filter.message_region; } - let region_text = self.localized_strings.get("hud.settings.region"); + let region_text = self.localized_strings.get_msg("hud-settings-region"); create_toggle_text(®ion_text, !chat_tab.filter.message_all) .right_from(state.ids.btn_messages_region, 5.0) .set(state.ids.text_messages_region, ui); @@ -537,7 +537,7 @@ impl<'a> Widget for Chat<'a> { updated_chat_tab.filter.message_say = !chat_tab.filter.message_say; } - let say_text = self.localized_strings.get("hud.settings.say"); + let say_text = self.localized_strings.get_msg("hud-settings-say"); create_toggle_text(&say_text, !chat_tab.filter.message_all) .right_from(state.ids.btn_messages_say, 5.0) .set(state.ids.text_messages_say, ui); @@ -547,7 +547,7 @@ impl<'a> Widget for Chat<'a> { .set(state.ids.icon_messages_say, ui); //Activity - Text::new(&self.localized_strings.get("hud.settings.activity")) + Text::new(&self.localized_strings.get_msg("hud-settings-activity")) .top_left_with_margins_on(state.ids.tab_content_align_r, 0.0, 5.0) .align_middle_y_of(state.ids.text_messages) .font_size(self.fonts.cyri.scale(16)) @@ -557,9 +557,9 @@ impl<'a> Widget for Chat<'a> { if let Some(clicked) = DropDownList::new( &[ - &self.localized_strings.get("hud.settings.none"), - &self.localized_strings.get("hud.settings.all"), - &self.localized_strings.get("hud.settings.group_only"), + &self.localized_strings.get_msg("hud-settings-none"), + &self.localized_strings.get_msg("hud-settings-all"), + &self.localized_strings.get_msg("hud-settings-group_only"), ], Some(if chat_tab.filter.activity_all { //all @@ -598,7 +598,7 @@ impl<'a> Widget for Chat<'a> { } //Death - Text::new(&self.localized_strings.get("hud.settings.death")) + Text::new(&self.localized_strings.get_msg("hud-settings-death")) .down_from(state.ids.list_activity, 20.0) .font_size(self.fonts.cyri.scale(16)) .font_id(self.fonts.cyri.conrod_id) @@ -607,9 +607,9 @@ impl<'a> Widget for Chat<'a> { if let Some(clicked) = DropDownList::new( &[ - &self.localized_strings.get("hud.settings.none"), - &self.localized_strings.get("hud.settings.all"), - &self.localized_strings.get("hud.settings.group_only"), + &self.localized_strings.get_msg("hud-settings-none"), + &self.localized_strings.get_msg("hud-settings-all"), + &self.localized_strings.get_msg("hud-settings-group_only"), ], Some(if chat_tab.filter.death_all { //all diff --git a/voxygen/src/hud/settings_window/controls.rs b/voxygen/src/hud/settings_window/controls.rs index a9113c59c5..2800f6c2bc 100644 --- a/voxygen/src/hud/settings_window/controls.rs +++ b/voxygen/src/hud/settings_window/controls.rs @@ -125,7 +125,7 @@ impl<'a> Widget for Controls<'a> { if self.global_state.window.remapping_keybindings == Some(game_input) { ( self.localized_strings - .get("hud.settings.awaitingkey") + .get_msg("hud-settings-awaitingkey") .into_owned(), TEXT_COLOR, ) @@ -146,14 +146,14 @@ impl<'a> Widget for Controls<'a> { } else { ( self.localized_strings - .get("hud.settings.unbound") + .get_msg("hud-settings-unbound") .into_owned(), ERROR_COLOR, ) }; let loc_key = self .localized_strings - .get(game_input.get_localization_key()); + .get_msg(game_input.get_localization_key()); let text_widget = Text::new(&loc_key) .color(TEXT_COLOR) .font_id(self.fonts.cyri.conrod_id) @@ -196,7 +196,7 @@ impl<'a> Widget for Controls<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(prev_id, 20.0) - .label(&self.localized_strings.get("hud.settings.reset_keybinds")) + .label(&self.localized_strings.get_msg("hud-settings-reset_keybinds")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/settings_window/gameplay.rs b/voxygen/src/hud/settings_window/gameplay.rs index dbffc915cb..0bbf6ca2fb 100644 --- a/voxygen/src/hud/settings_window/gameplay.rs +++ b/voxygen/src/hud/settings_window/gameplay.rs @@ -122,7 +122,7 @@ impl<'a> Widget for Gameplay<'a> { let display_clamp = self.global_state.settings.gameplay.camera_clamp_angle; // Mouse Pan Sensitivity - Text::new(&self.localized_strings.get("hud.settings.pan_sensitivity")) + Text::new(&self.localized_strings.get_msg("hud-setting-pan_sensitivity")) .top_left_with_margins_on(state.ids.window, 10.0, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -154,7 +154,7 @@ impl<'a> Widget for Gameplay<'a> { .set(state.ids.mouse_pan_value, ui); // Mouse Zoom Sensitivity - Text::new(&self.localized_strings.get("hud.settings.zoom_sensitivity")) + Text::new(&self.localized_strings.get_msg("hud-settings-zoom_sensitivity")) .down_from(state.ids.mouse_pan_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -189,7 +189,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.camera_clamp_angle"), + .get_msg("hud-settings-camera_clamp_angle"), ) .down_from(state.ids.mouse_zoom_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -242,7 +242,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.invert_scroll_zoom"), + .get_msg("hud-settings-invert_scroll_zoom"), ) .right_from(state.ids.mouse_zoom_invert_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -272,7 +272,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.invert_mouse_y_axis"), + .get_msg("hud-settings-invert_mouse_y_axis"), ) .right_from(state.ids.mouse_y_invert_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -302,7 +302,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.invert_controller_y_axis"), + .get_msg("hud-settings-invert_controller_y_axis"), ) .right_from(state.ids.controller_y_invert_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -332,7 +332,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.enable_mouse_smoothing"), + .get_msg("hud-settings-enable_mouse_smoothing"), ) .right_from(state.ids.smooth_pan_toggle_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -345,7 +345,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.free_look_behavior"), + .get_msg("hud-settings-free_look_behavior"), ) .down_from(state.ids.mouse_zoom_invert_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -355,9 +355,9 @@ impl<'a> Widget for Gameplay<'a> { let mode_label_list = [ self.localized_strings - .get("hud.settings.press_behavior.toggle"), + .get_msg("hud-settings-press_behavior-toggle"), self.localized_strings - .get("hud.settings.press_behavior.hold"), + .get_msg("hud-settings-press_behavior-hold"), ]; // Get which free look behavior is currently active @@ -382,7 +382,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.auto_walk_behavior"), + .get_msg("hud-settings-auto_walk_behavior"), ) .down_from(state.ids.mouse_zoom_invert_button, 10.0) .right_from(state.ids.free_look_behavior_text, 150.0) @@ -412,7 +412,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.camera_clamp_behavior"), + .get_msg("hud-settings-camera_clamp_behavior"), ) .down_from(state.ids.free_look_behavior_list, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -461,7 +461,7 @@ impl<'a> Widget for Gameplay<'a> { Text::new( &self .localized_strings - .get("hud.settings.stop_auto_walk_on_input"), + .get_msg("hud-settings-stop_auto_walk_on_input"), ) .right_from(state.ids.stop_auto_walk_on_input_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -488,7 +488,7 @@ impl<'a> Widget for Gameplay<'a> { )); } - Text::new(&self.localized_strings.get("hud.settings.auto_camera")) + Text::new(&self.localized_strings.get_msg("hud-settings-auto_camera")) .right_from(state.ids.auto_camera_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -512,7 +512,7 @@ impl<'a> Widget for Gameplay<'a> { events.push(ChangeBowZoom(!self.global_state.settings.gameplay.bow_zoom)); } - Text::new(&self.localized_strings.get("hud.settings.bow_zoom")) + Text::new(&self.localized_strings.get_msg("hud-settings-bow_zoom")) .right_from(state.ids.bow_zoom_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -526,7 +526,7 @@ impl<'a> Widget for Gameplay<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.camera_clamp_behavior_list, 12.0) - .label(&self.localized_strings.get("hud.settings.reset_gameplay")) + .label(&self.localized_strings.get_msg("hud-settings-reset_gameplay")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/settings_window/interface.rs b/voxygen/src/hud/settings_window/interface.rs index 2b74a5d42c..a8a3b2f958 100644 --- a/voxygen/src/hud/settings_window/interface.rs +++ b/voxygen/src/hud/settings_window/interface.rs @@ -174,7 +174,7 @@ impl<'a> Widget for Interface<'a> { let crosshair_type = self.global_state.settings.interface.crosshair_type; let ui_scale = self.global_state.settings.interface.ui_scale; - Text::new(&self.localized_strings.get("hud.settings.general")) + Text::new(&self.localized_strings.get_msg("hud-settings-general")) .top_left_with_margins_on(state.ids.window, 5.0, 5.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -197,7 +197,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleHelp(show_help)); } - Text::new(&self.localized_strings.get("hud.settings.help_window")) + Text::new(&self.localized_strings.get_msg("hud-settings-help_window")) .right_from(state.ids.button_help, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -223,7 +223,7 @@ impl<'a> Widget for Interface<'a> { )); } - Text::new(&self.localized_strings.get("hud.settings.loading_tips")) + Text::new(&self.localized_strings.get_msg("hud-settings-loading_tips")) .right_from(state.ids.load_tips_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -247,7 +247,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleDebug(show_debug)); } - Text::new(&self.localized_strings.get("hud.settings.debug_info")) + Text::new(&self.localized_strings.get_msg("hud-settings-debug_info")) .right_from(state.ids.debug_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -271,7 +271,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleHitboxes(show_hitboxes)); } - Text::new(&self.localized_strings.get("hud.settings.show_hitboxes")) + Text::new(&self.localized_strings.get_msg("hud-settings-show_hitboxes")) .right_from(state.ids.hitboxes_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -295,7 +295,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleChat(show_chat)); } - Text::new(&self.localized_strings.get("hud.settings.show_chat")) + Text::new(&self.localized_strings.get_msg("hud-settings-show_chat")) .right_from(state.ids.chat_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -319,7 +319,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleHotkeyHints(show_hotkey_hints)); } - Text::new(&self.localized_strings.get("hud.settings.show_hotkey_hints")) + Text::new(&self.localized_strings.get_msg("hud-settings-show_hotkey_hints")) .right_from(state.ids.hotkey_hints_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -328,7 +328,7 @@ impl<'a> Widget for Interface<'a> { .set(state.ids.hotkey_hints_button_label, ui); // Ui Scale - Text::new(&self.localized_strings.get("hud.settings.ui_scale")) + Text::new(&self.localized_strings.get_msg("hud-settings-ui_scale")) .down_from(state.ids.hotkey_hints_button, 20.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -362,7 +362,7 @@ impl<'a> Widget for Interface<'a> { events.push(UiScale(ScaleChange::ToRelative)); } - Text::new(&self.localized_strings.get("hud.settings.relative_scaling")) + Text::new(&self.localized_strings.get_msg("hud-settings-relative_scaling")) .right_from(state.ids.relative_to_win_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -397,7 +397,7 @@ impl<'a> Widget for Interface<'a> { events.push(UiScale(ScaleChange::ToAbsolute)); } - Text::new(&self.localized_strings.get("hud.settings.custom_scaling")) + Text::new(&self.localized_strings.get_msg("hud-settings-custom_scaling")) .right_from(state.ids.absolute_scale_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -574,13 +574,13 @@ impl<'a> Widget for Interface<'a> { .graphics_for(state.ids.ch_3_bg) .set(state.ids.crosshair_inner_3, ui); // Crosshair Transparency Text and Slider - Text::new(&self.localized_strings.get("hud.settings.crosshair")) + Text::new(&self.localized_strings.get_msg("hud-settings-crosshair")) .down_from(state.ids.absolute_scale_button, 20.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(state.ids.ch_title, ui); - Text::new(&self.localized_strings.get("hud.settings.opacity")) + Text::new(&self.localized_strings.get_msg("hud-settings-opacity")) .right_from(state.ids.ch_3_bg, 20.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -613,7 +613,7 @@ impl<'a> Widget for Interface<'a> { .set(state.ids.ch_transp_value, ui); // Hotbar text - Text::new(&self.localized_strings.get("hud.settings.hotbar")) + Text::new(&self.localized_strings.get_msg("hud-settings-hotbar")) .down_from(state.ids.ch_1_bg, 20.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -648,7 +648,7 @@ impl<'a> Widget for Interface<'a> { ShortcutNumbers::Off => events.push(ToggleShortcutNumbers(ShortcutNumbers::On)), } } - Text::new(&self.localized_strings.get("hud.settings.toggle_shortcuts")) + Text::new(&self.localized_strings.get_msg("hud-settings-toggle_shortcuts")) .right_from(state.ids.show_shortcuts_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -676,7 +676,7 @@ impl<'a> Widget for Interface<'a> { { events.push(BuffPosition(BuffPosition::Bar)) } - Text::new(&self.localized_strings.get("hud.settings.buffs_skillbar")) + Text::new(&self.localized_strings.get_msg("hud-settings-buffs_skillbar")) .right_from(state.ids.buff_pos_bar_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -703,7 +703,7 @@ impl<'a> Widget for Interface<'a> { { events.push(BuffPosition(BuffPosition::Map)) } - Text::new(&self.localized_strings.get("hud.settings.buffs_mmap")) + Text::new(&self.localized_strings.get_msg("hud-settings-buffs_mmap")) .right_from(state.ids.buff_pos_map_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -727,7 +727,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.scrolling_combat_text"), + .get_msg("hud-settings-scrolling_combat_text"), ) .top_left_with_margins_on(state.ids.window_r, 5.0, 5.0) .font_size(self.fonts.cyri.scale(18)) @@ -752,7 +752,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.scrolling_combat_text"), + .get_msg("hud-settings-scrolling_combat_text"), ) .right_from(state.ids.sct_show_radio, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -772,7 +772,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.damage_accumulation_duration"), + .get_msg("hud-settings-damage_accumulation_duration"), ) .down_from(state.ids.sct_show_radio, 8.0) .right_from(state.ids.sct_show_radio, 10.0) @@ -823,7 +823,7 @@ impl<'a> Widget for Interface<'a> { !self.global_state.settings.interface.sct_inc_dmg, )) } - Text::new(&self.localized_strings.get("hud.settings.incoming_damage")) + Text::new(&self.localized_strings.get_msg("hud-settings-incoming_damage")) .right_from(state.ids.sct_show_inc_dmg_radio, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -834,7 +834,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.incoming_damage_accumulation_duration"), + .get_msg("hud-settings-incoming_damage_accumulation_duration"), ) .down_from(state.ids.sct_show_inc_dmg_radio, 8.0) .right_from(state.ids.sct_show_inc_dmg_radio, 10.0) @@ -895,7 +895,7 @@ impl<'a> Widget for Interface<'a> { !self.global_state.settings.interface.sct_damage_rounding, )) } - Text::new(&self.localized_strings.get("hud.settings.round_damage")) + Text::new(&self.localized_strings.get_msg("hud-settings-round_damage")) .right_from(state.ids.sct_round_dmg_radio, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -905,7 +905,7 @@ impl<'a> Widget for Interface<'a> { } // Speech bubbles - Text::new(&self.localized_strings.get("hud.settings.speech_bubble")) + Text::new(&self.localized_strings.get_msg("hud-settings-speech_bubble")) .down_from( if self.global_state.settings.interface.sct { state.ids.sct_round_dmg_radio @@ -938,7 +938,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.speech_bubble_self"), + .get_msg("hud-settings-speech_bubble_self"), ) .right_from(state.ids.speech_bubble_self_button, 10.0) .font_size(self.fonts.cyri.scale(15)) @@ -963,7 +963,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.speech_bubble_dark_mode"), + .get_msg("hud-settings-speech_bubble_dark_mode"), ) .right_from(state.ids.speech_bubble_dark_mode_button, 10.0) .font_size(self.fonts.cyri.scale(15)) @@ -987,7 +987,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.speech_bubble_icon"), + .get_msg("hud-settings-speech_bubble_icon"), ) .right_from(state.ids.speech_bubble_icon_button, 10.0) .font_size(self.fonts.cyri.scale(15)) @@ -997,7 +997,7 @@ impl<'a> Widget for Interface<'a> { // Energybars Numbers // Hotbar text - Text::new(&self.localized_strings.get("hud.settings.energybar_numbers")) + Text::new(&self.localized_strings.get_msg("hud-settings-energybar_numbers")) .down_from(state.ids.speech_bubble_icon_button, 20.0) .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) @@ -1027,7 +1027,7 @@ impl<'a> Widget for Interface<'a> { { events.push(ToggleBarNumbers(BarNumbers::Off)) } - Text::new(&self.localized_strings.get("hud.settings.none")) + Text::new(&self.localized_strings.get_msg("hud-settings-none")) .right_from(state.ids.show_bar_numbers_none_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1058,7 +1058,7 @@ impl<'a> Widget for Interface<'a> { { events.push(ToggleBarNumbers(BarNumbers::Values)) } - Text::new(&self.localized_strings.get("hud.settings.values")) + Text::new(&self.localized_strings.get_msg("hud-settings-values")) .right_from(state.ids.show_bar_numbers_values_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1089,7 +1089,7 @@ impl<'a> Widget for Interface<'a> { { events.push(ToggleBarNumbers(BarNumbers::Percent)) } - Text::new(&self.localized_strings.get("hud.settings.percentages")) + Text::new(&self.localized_strings.get_msg("hud-settings-percentages")) .right_from(state.ids.show_bar_numbers_percentage_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1113,7 +1113,7 @@ impl<'a> Widget for Interface<'a> { events.push(ToggleAlwaysShowBars(always_show_bars)); } - Text::new(&self.localized_strings.get("hud.settings.always_show_bars")) + Text::new(&self.localized_strings.get_msg("hud-settings-always_show_bars")) .right_from(state.ids.always_show_bars_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1125,7 +1125,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.experience_numbers"), + .get_msg("hud-settings-experience_numbers"), ) .down_from(state.ids.always_show_bars_button, 20.0) .font_size(self.fonts.cyri.scale(18)) @@ -1154,7 +1154,7 @@ impl<'a> Widget for Interface<'a> { Text::new( &self .localized_strings - .get("hud.settings.accumulate_experience"), + .get_msg("hud-settings-accumulate_experience"), ) .right_from(state.ids.accum_experience_button, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -1169,7 +1169,7 @@ impl<'a> Widget for Interface<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.buff_pos_map_button, 12.0) - .label(&self.localized_strings.get("hud.settings.reset_interface")) + .label(&self.localized_strings.get_msg("hud-settings-reset_interface")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/settings_window/language.rs b/voxygen/src/hud/settings_window/language.rs index 0bfb16989d..b7efd48300 100644 --- a/voxygen/src/hud/settings_window/language.rs +++ b/voxygen/src/hud/settings_window/language.rs @@ -149,7 +149,7 @@ impl<'a> Widget for Language<'a> { events.push(ToggleEnglishFallback(show_english_fallback)); } - Text::new(&self.localized_strings.get("hud.settings.english_fallback")) + Text::new(&self.localized_strings.get_msg("hud-settings-english_fallback")) .right_from(state.ids.english_fallback_button, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/settings_window/mod.rs b/voxygen/src/hud/settings_window/mod.rs index 0e4f7d93fe..6b045ef933 100644 --- a/voxygen/src/hud/settings_window/mod.rs +++ b/voxygen/src/hud/settings_window/mod.rs @@ -61,27 +61,27 @@ pub enum SettingsTab { impl SettingsTab { fn name_key(&self) -> &str { match self { - SettingsTab::Interface => "common.interface", - SettingsTab::Chat => "common.chat", - SettingsTab::Gameplay => "common.gameplay", - SettingsTab::Controls => "common.controls", - SettingsTab::Video => "common.video", - SettingsTab::Sound => "common.sound", - SettingsTab::Lang => "common.languages", - SettingsTab::Networking => "common.networking", + SettingsTab::Interface => "common-interface", + SettingsTab::Chat => "common-chat", + SettingsTab::Gameplay => "common-gameplay", + SettingsTab::Controls => "common-controls", + SettingsTab::Video => "common-video", + SettingsTab::Sound => "common-sound", + SettingsTab::Lang => "common-languages", + SettingsTab::Networking => "common-networking", } } fn title_key(&self) -> &str { match self { - SettingsTab::Interface => "common.interface_settings", - SettingsTab::Chat => "common.chat_settings", - SettingsTab::Gameplay => "common.gameplay_settings", - SettingsTab::Controls => "common.controls_settings", - SettingsTab::Video => "common.video_settings", - SettingsTab::Sound => "common.sound_settings", - SettingsTab::Lang => "common.language_settings", - SettingsTab::Networking => "common.networking_settings", + SettingsTab::Interface => "common-interface_settings", + SettingsTab::Chat => "common-chat_settings", + SettingsTab::Gameplay => "common-gameplay_settings", + SettingsTab::Controls => "common-controls_settings", + SettingsTab::Video => "common-video_settings", + SettingsTab::Sound => "common-sound_settings", + SettingsTab::Lang => "common-language_settings", + SettingsTab::Networking => "common-networking_settings", } } } @@ -191,7 +191,7 @@ impl<'a> Widget for SettingsWindow<'a> { Text::new( &self .localized_strings - .get(self.show.settings_tab.title_key()), + .get_msg(self.show.settings_tab.title_key()), ) .mid_top_with_margin_on(state.ids.frame, 3.0) .font_id(self.fonts.cyri.conrod_id) @@ -220,7 +220,7 @@ impl<'a> Widget for SettingsWindow<'a> { }); } for (i, settings_tab) in SettingsTab::iter().enumerate() { - let tab_name = self.localized_strings.get(settings_tab.name_key()); + let tab_name = self.localized_strings.get_msg(settings_tab.name_key()); let mut button = Button::image(if self.show.settings_tab == settings_tab { self.imgs.selection } else { diff --git a/voxygen/src/hud/settings_window/networking.rs b/voxygen/src/hud/settings_window/networking.rs index ceb58e9c38..8a7904e55e 100644 --- a/voxygen/src/hud/settings_window/networking.rs +++ b/voxygen/src/hud/settings_window/networking.rs @@ -89,7 +89,7 @@ impl<'a> Widget for Networking<'a> { .set(state.ids.window_r, ui); // View Distance - Text::new(&self.localized_strings.get("hud.settings.view_distance")) + Text::new(&self.localized_strings.get_msg("hud-settings-view_distance")) .top_left_with_margins_on(state.ids.window, 10.0, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -127,7 +127,7 @@ impl<'a> Widget for Networking<'a> { Text::new( &self .localized_strings - .get("hud.settings.player_physics_behavior"), + .get_msg("hud-settings-player_physics_behavior"), ) .down_from(state.ids.vd_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -166,7 +166,7 @@ impl<'a> Widget for Networking<'a> { Text::new( &self .localized_strings - .get("hud.settings.lossy_terrain_compression"), + .get_msg("hud-settings-lossy_terrain_compression"), ) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -206,7 +206,7 @@ impl<'a> Widget for Networking<'a> { Text::new( &self .localized_strings - .get("hud.settings.third_party_integrations"), + .get_msg("hud-settings-third_party_integrations"), ) .down_from(state.ids.player_physics_behavior_list, 16.0) .font_size(self.fonts.cyri.scale(18)) @@ -248,7 +248,7 @@ impl<'a> Widget for Networking<'a> { Text::new( &self .localized_strings - .get("hud.settings.enable_discord_integration"), + .get_msg("hud-settings-enable_discord_integration"), ) .right_from(state.ids.enable_discord_integration_button, 10.0) .font_size(self.fonts.cyri.scale(14)) diff --git a/voxygen/src/hud/settings_window/sound.rs b/voxygen/src/hud/settings_window/sound.rs index 0ce9c106bc..dc048f8432 100644 --- a/voxygen/src/hud/settings_window/sound.rs +++ b/voxygen/src/hud/settings_window/sound.rs @@ -108,7 +108,7 @@ impl<'a> Widget for Sound<'a> { .set(state.ids.window_scrollbar, ui); // Master Volume - Text::new(&self.localized_strings.get("hud.settings.master_volume")) + Text::new(&self.localized_strings.get_msg("hud-settings-master_volume")) .top_left_with_margins_on(state.ids.window, 10.0, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -146,7 +146,7 @@ impl<'a> Widget for Sound<'a> { Text::new( &self .localized_strings - .get("hud.settings.inactive_master_volume_perc"), + .get_msg("hud-settings-inactive_master_volume_perc"), ) .down_from(state.ids.master_volume_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -182,7 +182,7 @@ impl<'a> Widget for Sound<'a> { .set(state.ids.inactive_master_volume_number, ui); // Music Volume - Text::new(&self.localized_strings.get("hud.settings.music_volume")) + Text::new(&self.localized_strings.get_msg("hud-settings-music_volume")) .down_from(state.ids.inactive_master_volume_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -220,7 +220,7 @@ impl<'a> Widget for Sound<'a> { Text::new( &self .localized_strings - .get("hud.settings.sound_effect_volume"), + .get_msg("hud-settings-sound_effect_volume"), ) .down_from(state.ids.music_volume_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -255,7 +255,7 @@ impl<'a> Widget for Sound<'a> { .color(TEXT_COLOR) .set(state.ids.sfx_volume_number, ui); // Ambience Volume - Text::new(&self.localized_strings.get("hud.settings.ambience_volume")) + Text::new(&self.localized_strings.get_msg("hud-settings-ambience_volume")) .down_from(state.ids.sfx_volume_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -290,7 +290,7 @@ impl<'a> Widget for Sound<'a> { .set(state.ids.ambience_volume_number, ui); // Music spacing - Text::new(&self.localized_strings.get("hud.settings.music_spacing")) + Text::new(&self.localized_strings.get_msg("hud-settings-music_spacing")) .down_from(state.ids.ambience_volume_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -357,7 +357,7 @@ impl<'a> Widget for Sound<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.music_spacing_slider, 12.0) - .label(&self.localized_strings.get("hud.settings.reset_sound")) + .label(&self.localized_strings.get_msg("hud-settings-reset_sound")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/settings_window/video.rs b/voxygen/src/hud/settings_window/video.rs index 037d4eb515..8d23cab482 100644 --- a/voxygen/src/hud/settings_window/video.rs +++ b/voxygen/src/hud/settings_window/video.rs @@ -277,7 +277,7 @@ impl<'a> Widget for Video<'a> { } // View Distance - Text::new(&self.localized_strings.get("hud.settings.view_distance")) + Text::new(&self.localized_strings.get_msg("hud-settings-view_distance")) .top_left_with_margins_on(state.ids.window, 10.0, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -312,7 +312,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.vd_value, ui); // LoD Distance - Text::new(&self.localized_strings.get("hud.settings.lod_distance")) + Text::new(&self.localized_strings.get_msg("hud-settings-lod_distance")) .down_from(state.ids.vd_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -347,7 +347,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.ld_value, ui); // Max FPS - Text::new(&self.localized_strings.get("hud.settings.maximum_fps")) + Text::new(&self.localized_strings.get_msg("hud-settings-maximum_fps")) .down_from(state.ids.ld_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -382,7 +382,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.max_fps_value, ui); // Max Background FPS - Text::new(&self.localized_strings.get("hud.settings.background_fps")) + Text::new(&self.localized_strings.get_msg("hud-settings-background_fps")) .down_from(state.ids.ld_slider, 10.0) .right_from(state.ids.max_fps_value, 30.0) .font_size(self.fonts.cyri.scale(14)) @@ -430,7 +430,7 @@ impl<'a> Widget for Video<'a> { let render_mode = &self.global_state.settings.graphics.render_mode; // Present Mode - Text::new(&self.localized_strings.get("hud.settings.present_mode")) + Text::new(&self.localized_strings.get_msg("hud-settings-present_mode")) .down_from(state.ids.ld_slider, 10.0) .right_from(state.ids.max_background_fps_value, 30.0) .font_size(self.fonts.cyri.scale(14)) @@ -444,13 +444,13 @@ impl<'a> Widget for Video<'a> { PresentMode::Immediate, ]; let mode_label_list = [ - &self.localized_strings.get("hud.settings.present_mode.fifo"), + &self.localized_strings.get_msg("hud-settings-present_mode-fifo"), &self .localized_strings - .get("hud.settings.present_mode.mailbox"), + .get_msg("hud-settings-present_mode-mailbox"), &self .localized_strings - .get("hud.settings.present_mode.immediate"), + .get_msg("hud-settings-present_mode.immediate"), ]; // Get which present mode is currently active @@ -474,7 +474,7 @@ impl<'a> Widget for Video<'a> { } // FOV - Text::new(&self.localized_strings.get("hud.settings.fov")) + Text::new(&self.localized_strings.get_msg("hud-settings-fov")) .down_from(state.ids.max_fps_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -506,7 +506,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.fov_value, ui); // LoD detail - Text::new(&self.localized_strings.get("hud.settings.lod_detail")) + Text::new(&self.localized_strings.get_msg("hud-settings-lod_detail")) .down_from(state.ids.fov_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -544,7 +544,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.lod_detail_value, ui); // Gamma - Text::new(&self.localized_strings.get("hud.settings.gamma")) + Text::new(&self.localized_strings.get_msg("hud-settings-gamma")) .down_from(state.ids.lod_detail_slider, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -595,7 +595,7 @@ impl<'a> Widget for Video<'a> { events.push(GraphicsChange::ChangeExposure(new_val as f32 / 16.0)); } - Text::new(&self.localized_strings.get("hud.settings.exposure")) + Text::new(&self.localized_strings.get_msg("hud-settings-exposure")) .up_from(state.ids.exposure_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -629,7 +629,7 @@ impl<'a> Widget for Video<'a> { { events.push(GraphicsChange::ChangeAmbiance(new_val as f32 / 100.0)); } - Text::new(&self.localized_strings.get("hud.settings.ambiance")) + Text::new(&self.localized_strings.get_msg("hud-settings-ambiance")) .up_from(state.ids.ambiance_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -665,7 +665,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.sprites_view_distance"), + .get_msg("hud-settings-sprites_view_distance"), ) .up_from(state.ids.sprite_dist_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -705,7 +705,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.figures_view_distance"), + .get_msg("hud-settings-figures_view_distance"), ) .up_from(state.ids.figure_dist_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -727,7 +727,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.figure_dist_value, ui); // AaMode - Text::new(&self.localized_strings.get("hud.settings.antialiasing_mode")) + Text::new(&self.localized_strings.get_msg("hud-settings-antialiasing_mode")) .down_from(state.ids.gamma_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -775,7 +775,7 @@ impl<'a> Widget for Video<'a> { }; let max_bloom = 0.3; - Text::new(&self.localized_strings.get("hud.settings.bloom")) + Text::new(&self.localized_strings.get_msg("hud-settings-bloom")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.aa_mode_list, 10.0) @@ -827,7 +827,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.bloom_intensity_value, ui); // Point Glow - Text::new(&self.localized_strings.get("hud.settings.point_glow")) + Text::new(&self.localized_strings.get_msg("hud-settings-point_glow")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.aa_mode_list, 10.0) @@ -866,7 +866,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.point_glow_value, ui); // Upscaling factor - Text::new(&self.localized_strings.get("hud.settings.upscale_factor")) + Text::new(&self.localized_strings.get_msg("hud-settings-upscale_factor")) .down_from(state.ids.bloom_intensity_slider, 8.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -911,7 +911,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.cloud_rendering_mode"), + .get_msg("hud-settings-cloud_rendering_mode"), ) .down_from(state.ids.upscale_factor_list, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -928,17 +928,17 @@ impl<'a> Widget for Video<'a> { CloudMode::Ultra, ]; let mode_label_list = [ - self.localized_strings.get("common.none"), + self.localized_strings.get_msg("common-none"), self.localized_strings - .get("hud.settings.cloud_rendering_mode.minimal"), + .get_msg("hud-settings-cloud_rendering_mode-minimal"), self.localized_strings - .get("hud.settings.cloud_rendering_mode.low"), + .get_msg("hud-settings-cloud_rendering_mode-low"), self.localized_strings - .get("hud.settings.cloud_rendering_mode.medium"), + .get_msg("hud-settings-cloud_rendering_mode-medium"), self.localized_strings - .get("hud.settings.cloud_rendering_mode.high"), + .get_msg("hud-settings-cloud_rendering_mode-high"), self.localized_strings - .get("hud.settings.cloud_rendering_mode.ultra"), + .get_msg("hud-settings-cloud_rendering_mode-ultra"), ]; // Get which cloud rendering mode is currently active @@ -962,7 +962,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.fluid_rendering_mode"), + .get_msg("hud-settings-fluid_rendering_mode"), ) .down_from(state.ids.cloud_mode_list, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -973,9 +973,9 @@ impl<'a> Widget for Video<'a> { let mode_list = [FluidMode::Cheap, FluidMode::Shiny]; let mode_label_list = [ self.localized_strings - .get("hud.settings.fluid_rendering_mode.cheap"), + .get_msg("hud-settings-fluid_rendering_mode-cheap"), self.localized_strings - .get("hud.settings.fluid_rendering_mode.shiny"), + .get_msg("hud-settings-fluid_rendering_mode-shiny"), ]; // Get which fluid rendering mode is currently active @@ -999,7 +999,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.lighting_rendering_mode"), + .get_msg("hud-settings-lighting_rendering_mode"), ) .down_from(state.ids.fluid_mode_list, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -1014,11 +1014,11 @@ impl<'a> Widget for Video<'a> { ]; let mode_label_list = [ self.localized_strings - .get("hud.settings.lighting_rendering_mode.ashikhmin"), + .get_msg("hud-settings-lighting_rendering_mode-ashikhmin"), self.localized_strings - .get("hud.settings.lighting_rendering_mode.blinnphong"), + .get_msg("hud-settings-lighting_rendering_mode-blinnphong"), self.localized_strings - .get("hud.settings.lighting_rendering_mode.lambertian"), + .get_msg("hud-settings-lighting_rendering_mode-lambertian"), ]; // Get which lighting rendering mode is currently active @@ -1042,7 +1042,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.shadow_rendering_mode"), + .get_msg("hud-settings-shadow_rendering_mode"), ) .down_from(state.ids.lighting_mode_list, 8.0) .font_size(self.fonts.cyri.scale(14)) @@ -1058,11 +1058,11 @@ impl<'a> Widget for Video<'a> { ]; let mode_label_list = [ self.localized_strings - .get("hud.settings.shadow_rendering_mode.none"), + .get_msg("hud-settings-shadow_rendering_mode-none"), self.localized_strings - .get("hud.settings.shadow_rendering_mode.cheap"), + .get_msg("hud-settings-shadow_rendering_mode-cheap"), self.localized_strings - .get("hud.settings.shadow_rendering_mode.map"), + .get_msg("hud-settings-shadow_rendering_mode-map"), ]; // Get which shadow rendering mode is currently active @@ -1087,7 +1087,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.shadow_rendering_mode.map.resolution"), + .get_msg("hud-settings-shadow_rendering_mode-map-resolution"), ) .right_from(state.ids.shadow_mode_list, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -1132,7 +1132,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.rain_occlusion.resolution"), + .get_msg("hud-settings-rain_occlusion-resolution"), ) .down_from(state.ids.shadow_mode_list, 10.0) .font_size(self.fonts.cyri.scale(14)) @@ -1169,7 +1169,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.rain_map_resolution_value, ui); // GPU Profiler - Text::new(&self.localized_strings.get("hud.settings.gpu_profiler")) + Text::new(&self.localized_strings.get_msg("hud-settings-gpu_profiler")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.rain_map_resolution_text, 8.0) @@ -1195,7 +1195,7 @@ impl<'a> Widget for Video<'a> { } // Particles - Text::new(&self.localized_strings.get("hud.settings.particles")) + Text::new(&self.localized_strings.get_msg("hud-settings-particles")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.gpu_profiler_label, 8.0) @@ -1218,7 +1218,7 @@ impl<'a> Widget for Video<'a> { } // Weapon trails - Text::new(&self.localized_strings.get("hud.settings.weapon_trails")) + Text::new(&self.localized_strings.get_msg("hud-settings-weapon_trails")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .right_from(state.ids.particles_label, 64.0) @@ -1243,7 +1243,7 @@ impl<'a> Widget for Video<'a> { } // Disable flashing lights - Text::new(&self.localized_strings.get("hud.settings.flashing_lights")) + Text::new(&self.localized_strings.get_msg("hud-settings-flashing_lights")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.particles_label, 25.0) @@ -1268,7 +1268,7 @@ impl<'a> Widget for Video<'a> { Text::new( &self .localized_strings - .get("hud.settings.flashing_lights_info"), + .get_msg("hud-settings-flashing_lights_info"), ) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1300,7 +1300,7 @@ impl<'a> Widget for Video<'a> { .dedup() .collect(); - Text::new(&self.localized_strings.get("hud.settings.resolution")) + Text::new(&self.localized_strings.get_msg("hud-settings-resolution")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.flashing_lights_label, 25.0) @@ -1359,7 +1359,7 @@ impl<'a> Widget for Video<'a> { .dedup() .collect(); - Text::new(&self.localized_strings.get("hud.settings.bit_depth")) + Text::new(&self.localized_strings.get_msg("hud-settings-bit_depth")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.flashing_lights_label, 25.0) @@ -1368,7 +1368,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.bit_depth_label, ui); if let Some(clicked) = DropDownList::new( - once(String::from(self.localized_strings.get("common.automatic"))) + once(String::from(self.localized_strings.get_msg("common-automatic"))) .chain(bit_depths.iter().map(|depth| format!("{}", depth))) .collect::>() .as_slice(), @@ -1413,7 +1413,7 @@ impl<'a> Widget for Video<'a> { .dedup() .collect(); - Text::new(&self.localized_strings.get("hud.settings.refresh_rate")) + Text::new(&self.localized_strings.get_msg("hud-settings-refresh_rate")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.flashing_lights_label, 25.0) @@ -1422,7 +1422,7 @@ impl<'a> Widget for Video<'a> { .set(state.ids.refresh_rate_label, ui); if let Some(clicked) = DropDownList::new( - once(String::from(self.localized_strings.get("common.automatic"))) + once(String::from(self.localized_strings.get_msg("common-automatic"))) .chain(refresh_rates.iter().map(|rate| format!("{}", rate))) .collect::>() .as_slice(), @@ -1453,7 +1453,7 @@ impl<'a> Widget for Video<'a> { } // Fullscreen - Text::new(&self.localized_strings.get("hud.settings.fullscreen")) + Text::new(&self.localized_strings.get_msg("hud-settings-fullscreen")) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) .down_from(state.ids.resolution, 8.0) @@ -1479,7 +1479,7 @@ impl<'a> Widget for Video<'a> { } // Fullscreen Mode - Text::new(&self.localized_strings.get("hud.settings.fullscreen_mode")) + Text::new(&self.localized_strings.get_msg("hud-settings-fullscreen_mode")) .down_from(state.ids.fullscreen_label, 8.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -1490,10 +1490,10 @@ impl<'a> Widget for Video<'a> { let mode_label_list = [ &self .localized_strings - .get("hud.settings.fullscreen_mode.exclusive"), + .get_msg("hud-settings-fullscreen_mode-exclusive"), &self .localized_strings - .get("hud.settings.fullscreen_mode.borderless"), + .get_msg("hud-settings-fullscreen_mode-borderless"), ]; // Get which fullscreen mode is currently active @@ -1521,7 +1521,7 @@ impl<'a> Widget for Video<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.fullscreen_mode_list, 12.0) - .label(&self.localized_strings.get("hud.settings.save_window_size")) + .label(&self.localized_strings.get_msg("hud-settings-save_window_size")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) @@ -1545,7 +1545,7 @@ impl<'a> Widget for Video<'a> { .press_image(self.imgs.button_press) .down_from(state.ids.fullscreen_mode_list, 12.0) .right_from(state.ids.save_window_size_button, 12.0) - .label(&self.localized_strings.get("hud.settings.reset_graphics")) + .label(&self.localized_strings.get_msg("hud-settings-reset_graphics")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index b71577d4dd..b6c4a15ff6 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -333,7 +333,7 @@ impl<'a> Skillbar<'a> { .controls .get_binding(GameInput::Respawn) { - Text::new(&localized_strings.get("hud.you_died")) + Text::new(&localized_strings.get_msg("hud-you_died")) .middle_of(ui.window) .font_size(self.fonts.cyri.scale(50)) .font_id(self.fonts.cyri.conrod_id) @@ -349,7 +349,7 @@ impl<'a> Skillbar<'a> { .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .set(state.ids.death_message_2_bg, ui); - Text::new(&localized_strings.get("hud.you_died")) + Text::new(&localized_strings.get_msg("hud-you_died")) .bottom_left_with_margins_on(state.ids.death_message_1_bg, 2.0, 2.0) .font_size(self.fonts.cyri.scale(50)) .font_id(self.fonts.cyri.conrod_id) @@ -455,8 +455,8 @@ impl<'a> Skillbar<'a> { // Bar Text let bar_text = if self.health.is_dead { Some(( - self.localized_strings.get("hud.group.dead").into_owned(), - self.localized_strings.get("hud.group.dead").into_owned(), + self.localized_strings.get_msg("hud-group-dead").into_owned(), + self.localized_strings.get_msg("hud-group-dead").into_owned(), )) } else if let BarNumbers::Values = bar_values { Some(( diff --git a/voxygen/src/hud/social.rs b/voxygen/src/hud/social.rs index 3e55c4905a..3c5a8b6fd8 100644 --- a/voxygen/src/hud/social.rs +++ b/voxygen/src/hud/social.rs @@ -159,7 +159,7 @@ impl<'a> Widget for Social<'a> { Rectangle::fill_with([212.0, 42.0], color::TRANSPARENT) .top_left_with_margins_on(state.ids.frame, 2.0, 44.0) .set(state.ids.title_align, ui); - Text::new(&self.localized_strings.get("hud.social")) + Text::new(&self.localized_strings.get_msg("hud-social")) .middle_of(state.ids.title_align) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(20)) @@ -184,7 +184,7 @@ impl<'a> Widget for Social<'a> { .set(state.ids.scrollbar, ui); // Online Text - Text::new(&self.localized_strings.get("hud.social.online")) + Text::new(&self.localized_strings.get_msg("hud-social-online")) .bottom_left_with_margins_on(state.ids.frame, 18.0, 10.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) @@ -255,12 +255,12 @@ impl<'a> Widget for Social<'a> { None => format!( "{} [{}]", alias.clone(), - self.localized_strings.get("hud.group.in_menu") + self.localized_strings.get_msg("hud-group-in_menu") ), // character select or spectating }; let acc_name_txt = format!( "{}: {}", - &self.localized_strings.get("hud.social.account"), + &self.localized_strings.get_msg("hud-social-account"), alias ); // Player name widget @@ -347,7 +347,7 @@ impl<'a> Widget for Social<'a> { }) .flatten(); - let invite_text = self.localized_strings.get("hud.group.invite"); + let invite_text = self.localized_strings.get_msg("hud-group-invite"); let invite_button = Button::image(self.imgs.button) .w_h(106.0, 26.0) .bottom_right_with_margins_on(state.ids.frame, 9.0, 7.0) @@ -381,7 +381,7 @@ impl<'a> Widget for Social<'a> { "{}/{} {}", current_members + current_invites, max_members, - &self.localized_strings.get("hud.group.members") + &self.localized_strings.get_msg("hud-group-members") ); invite_button .with_tooltip( diff --git a/voxygen/src/hud/trade.rs b/voxygen/src/hud/trade.rs index 6a3b299e8b..afe2f6d150 100644 --- a/voxygen/src/hud/trade.rs +++ b/voxygen/src/hud/trade.rs @@ -140,13 +140,13 @@ impl<'a> Trade<'a> { } fn title(&mut self, state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>) { - Text::new(&self.localized_strings.get("hud.trade.trade_window")) + Text::new(&self.localized_strings.get_msg("hud-trade-trade_window")) .mid_top_with_margin_on(state.ids.bg_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(20)) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .set(state.ids.trade_title_bg, ui); - Text::new(&self.localized_strings.get("hud.trade.trade_window")) + Text::new(&self.localized_strings.get_msg("hud-trade-trade_window")) .top_left_with_margins_on(state.ids.trade_title_bg, 2.0, 2.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(20)) @@ -161,9 +161,9 @@ impl<'a> Trade<'a> { trade: &'a PendingTrade, ) { let phase_text = match trade.phase() { - TradePhase::Mutate => self.localized_strings.get("hud.trade.phase1_description"), - TradePhase::Review => self.localized_strings.get("hud.trade.phase2_description"), - TradePhase::Complete => self.localized_strings.get("hud.trade.phase3_description"), + TradePhase::Mutate => self.localized_strings.get_msg("hud-trade-phase1_description"), + TradePhase::Review => self.localized_strings.get_msg("hud-trade-phase2_description"), + TradePhase::Complete => self.localized_strings.get_msg("hud-trade-phase3_description"), }; Text::new(&phase_text) @@ -223,11 +223,11 @@ impl<'a> Trade<'a> { let offer_header = if ours { self.localized_strings - .get("hud.trade.your_offer") + .get_msg("hud-trade-your_offer") .to_owned() } else { self.localized_strings - .get("hud.trade.their_offer") + .get_msg("hud-trade-their_offer") .to_owned() }; @@ -515,7 +515,7 @@ impl<'a> Trade<'a> { .press_image(press_img) .image_color(accept_button_luminance) .bottom_left_with_margins_on(state.ids.bg, 90.0, 47.0) - .label(&self.localized_strings.get("hud.trade.accept")) + .label(&self.localized_strings.get_msg("hud-trade-accept")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) @@ -531,7 +531,7 @@ impl<'a> Trade<'a> { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .right_from(state.ids.accept_button, 20.0) - .label(&self.localized_strings.get("hud.trade.decline")) + .label(&self.localized_strings.get_msg("hud-trade-decline")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) @@ -662,7 +662,7 @@ impl<'a> Trade<'a> { } } else { // placeholder text when no trade slot is selected - Text::new(&self.localized_strings.get("hud.trade.amount_input")) + Text::new(&self.localized_strings.get_msg("hud-trade-amount_input")) .middle_of(state.ids.amount_bg) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 00ec248e99..7a0207726d 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -224,7 +224,7 @@ impl PlayState for CharSelectionState { client::Event::Disconnect => { global_state.info_message = Some( localized_strings - .get("main.login.server_shut_down") + .get_msg("main-login-server_shut_down") .into_owned(), ); return PlayStateResult::Pop; @@ -241,7 +241,7 @@ impl PlayState for CharSelectionState { }, Err(err) => { global_state.info_message = - Some(localized_strings.get("common.connection_lost").into_owned()); + Some(localized_strings.get_msg("common-connection_lost").into_owned()); error!(?err, "[char_selection] Failed to tick the client"); return PlayStateResult::Pop; }, diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 772631e4a0..e72c2d8109 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -240,7 +240,7 @@ impl PlayState for MainMenuState { client::Event::Disconnect => { global_state.info_message = Some( localized_strings - .get("main.login.server_shut_down") + .get_msg("main-login-server_shut_down") .into_owned(), ); self.init = InitState::None; @@ -251,7 +251,7 @@ impl PlayState for MainMenuState { }, Err(err) => { global_state.info_message = - Some(localized_strings.get("common.connection_lost").into_owned()); + Some(localized_strings.get_msg("common-connection_lost").into_owned()); error!(?err, "[main menu] Failed to tick the client"); self.init = InitState::None; }, @@ -420,18 +420,18 @@ fn get_client_msg_error( if let Some(server_info) = mismatched_server_info { format!( "{} {}: {} ({}) {}: {} ({})", - localization.get("main.login.network_wrong_version"), - localization.get("main.login.client_version"), + localization.get_msg("main-login-network_wrong_version"), + localization.get_msg("main-login-client_version"), &*common::util::GIT_HASH, &*common::util::GIT_DATE, - localization.get("main.login.server_version"), + localization.get_msg("main-login-server_version"), server_info.git_hash, server_info.git_date, ) } else { format!( "{}: {}", - localization.get("main.login.network_error"), + localization.get_msg("main-login-network_error"), error ) } @@ -444,30 +444,30 @@ fn get_client_msg_error( mismatched_server_info, } => match error { Error::SpecsErr(e) => { - format!("{}: {}", localization.get("main.login.internal_error"), e) + format!("{}: {}", localization.get_msg("main-login-internal_error"), e) }, Error::AuthErr(e) => format!( "{}: {}", - localization.get("main.login.authentication_error"), + localization.get_msg("main-login-authentication_error"), e ), Error::Kicked(e) => e, - Error::TooManyPlayers => localization.get("main.login.server_full").into(), + Error::TooManyPlayers => localization.get_msg("main-login-server_full").into(), Error::AuthServerNotTrusted => { - localization.get("main.login.untrusted_auth_server").into() + localization.get_msg("main-login-untrusted_auth_server").into() }, - Error::ServerTimeout => localization.get("main.login.timeout").into(), - Error::ServerShutdown => localization.get("main.login.server_shut_down").into(), - Error::NotOnWhitelist => localization.get("main.login.not_on_whitelist").into(), + Error::ServerTimeout => localization.get_msg("main-login-timeout").into(), + Error::ServerShutdown => localization.get_msg("main-login-server_shut_down").into(), + Error::NotOnWhitelist => localization.get_msg("main-login-not_on_whitelist").into(), Error::Banned(reason) => { - format!("{}: {}", localization.get("main.login.banned"), reason) + format!("{}: {}", localization.get_msg("main-login-banned"), reason) }, - Error::InvalidCharacter => localization.get("main.login.invalid_character").into(), + Error::InvalidCharacter => localization.get_msg("main-login-invalid_character").into(), Error::NetworkErr(NetworkError::ConnectFailed(NetworkConnectError::Handshake( InitProtocolError::WrongVersion(_), ))) => net_error( localization - .get("main.login.network_wrong_version") + .get_msg("main-login-network_wrong_version") .into_owned(), mismatched_server_info, ), @@ -475,38 +475,38 @@ fn get_client_msg_error( Error::ParticipantErr(e) => net_error(e.to_string(), mismatched_server_info), Error::StreamErr(e) => net_error(e.to_string(), mismatched_server_info), Error::HostnameLookupFailed(e) => { - format!("{}: {}", localization.get("main.login.server_not_found"), e) + format!("{}: {}", localization.get_msg("main-login-server_not_found"), e) }, Error::Other(e) => { - format!("{}: {}", localization.get("common.error"), e) + format!("{}: {}", localization.get_msg("common-error"), e) }, Error::AuthClientError(e) => match e { // TODO: remove parentheses client::AuthClientError::RequestError(e) => format!( "{}: {}", - localization.get("main.login.failed_sending_request"), + localization.get_msg("main-login-failed_sending_request"), e ), client::AuthClientError::JsonError(e) => format!( "{}: {}", - localization.get("main.login.failed_sending_request"), + localization.get_msg("main-login-failed_sending_request"), e ), client::AuthClientError::InsecureSchema => { - localization.get("main.login.insecure_auth_scheme").into() + localization.get_msg("main-login-insecure_auth_scheme").into() }, client::AuthClientError::ServerError(_, e) => String::from_utf8_lossy(&e).into(), }, Error::AuthServerUrlInvalid(e) => { format!( "{}: https://{}", - localization.get("main.login.failed_auth_server_url_invalid"), + localization.get_msg("main-login-failed_auth_server_url_invalid"), e ) }, }, - InitError::ClientCrashed => localization.get("main.login.client_crashed").into(), - InitError::ServerNotFound => localization.get("main.login.server_not_found").into(), + InitError::ClientCrashed => localization.get_msg("main-login-client_crashed").into(), + InitError::ServerNotFound => localization.get_msg("main-login-server_not_found").into(), } } @@ -525,7 +525,7 @@ fn attempt_login( comp::AliasError::ForbiddenCharacters => { *info_message = Some( localization - .get("main.login.username_bad_characters") + .get_msg("main-login-username_bad_characters") .into_owned(), ); }, diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 432d19db0a..f3ab46bdff 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -343,7 +343,7 @@ impl SessionState { client::Event::Kicked(reason) => { global_state.info_message = Some(format!( "{}: {}", - global_state.i18n.read().get("main.login.kicked"), + global_state.i18n.read().get_msg("main-login-kicked"), reason )); return Ok(TickAction::Disconnect); @@ -1187,7 +1187,7 @@ impl PlayState for SessionState { global_state .i18n .read() - .get("common.connection_lost") + .get_msg("common-connection_lost") .into_owned(), ); error!("[session] Failed to tick the scene: {:?}", err); diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index 7ffa996514..ee25ec8360 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -1265,8 +1265,8 @@ impl<'a> Widget for ItemTooltip<'a> { ) { // Get localized tooltip strings (gotten here because these should // only show if in a trade- aka if buy/sell prices are present) - let tt_hint_1 = self.localized_strings.get("hud.trade.tooltip_hint_1"); - let tt_hint_2 = self.localized_strings.get("hud.trade.tooltip_hint_2"); + let tt_hint_1 = self.localized_strings.get_msg("hud-trade-tooltip_hint_1"); + let tt_hint_2 = self.localized_strings.get_msg("hud-trade-tooltip_hint_2"); widget::Text::new(&format!("{}\n{}\n{}\n{}", buy, sell, tt_hint_1, tt_hint_2)) .with_style(self.style.desc)