diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index bf0ab6bbae..4c3d916e49 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -195,8 +195,8 @@ um dieses Fenster zu schließen? Drückt 'TAB'! Viel Spaß in der Welt von Veloren, Abenteurer!"#, // Inventory - "hud.bag.inventory": "s Inventar", - "hud.bag.stats_title": "s Werte", + "hud.bag.inventory": "{name}s Inventar", + "hud.bag.stats_title": "{playername}s Werte", "hud.bag.exp": "Erf", "hud.bag.armor": "Rüstung", "hud.bag.stats": "Werte", diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 7ce2170022..219335f322 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -190,8 +190,8 @@ Enjoy your stay in the World of Veloren."#, // Inventory - "hud.bag.inventory": "'s Inventory", - "hud.bag.stats_title": "'s Stats", + "hud.bag.inventory": "{playername}'s Inventory", + "hud.bag.stats_title": "{playername}'s Stats", "hud.bag.exp": "Exp", "hud.bag.armor": "Armor", "hud.bag.stats": "Stats", diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index a4a21791de..fed6a7e0fc 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -94,6 +94,7 @@ pub struct Bag<'a> { slot_manager: &'a mut HudSlotManager, _pulse: f32, localized_strings: &'a std::sync::Arc, + stats: &'a Stats, show: &'a Show, } @@ -217,21 +218,28 @@ impl<'a> Widget for Bag<'a> { .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.bg_frame, ui); // Title - Text::new(&format!( + /*Text::new(&format!( "{}{}", &self.stats.name, &self.localized_strings.get("hud.bag.inventory") - )) + ))*/ + Text::new( + &self + .localized_strings + .get("hud.bag.inventory") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .mid_top_with_margin_on(state.ids.bg_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22)) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .set(state.ids.inventory_title_bg, ui); - Text::new(&format!( - "{}{}", - &self.stats.name, - &self.localized_strings.get("hud.bag.inventory") - )) + Text::new( + &self + .localized_strings + .get("hud.bag.inventory") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .top_left_with_margins_on(state.ids.inventory_title_bg, 2.0, 2.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22)) @@ -280,21 +288,23 @@ impl<'a> Widget for Bag<'a> { if !self.show.stats { // Title - Text::new(&format!( - "{}{}", - &self.stats.name, - &self.localized_strings.get("hud.bag.inventory") - )) + Text::new( + &self + .localized_strings + .get("hud.bag.inventory") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .mid_top_with_margin_on(state.ids.bg_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22)) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .set(state.ids.inventory_title_bg, ui); - Text::new(&format!( - "{}{}", - &self.stats.name, - &self.localized_strings.get("hud.bag.inventory") - )) + Text::new( + &self + .localized_strings + .get("hud.bag.inventory") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .top_left_with_margins_on(state.ids.inventory_title_bg, 2.0, 2.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22)) @@ -510,21 +520,23 @@ impl<'a> Widget for Bag<'a> { } else { // Stats // Title - Text::new(&format!( - "{}{}", - &self.stats.name, - &self.localized_strings.get("hud.bag.stats_title") - )) + Text::new( + &self + .localized_strings + .get("hud.bag.stats_title") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .mid_top_with_margin_on(state.ids.bg_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22)) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .set(state.ids.inventory_title_bg, ui); - Text::new(&format!( - "{}{}", - &self.stats.name, - &self.localized_strings.get("hud.bag.stats_title") - )) + Text::new( + &self + .localized_strings + .get("hud.bag.stats_title") + .replace("{playername}", &self.stats.name.to_string().as_str()), + ) .top_left_with_margins_on(state.ids.inventory_title_bg, 2.0, 2.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(22))