in the process of cleaning up i18n.gte calls

This commit is contained in:
parzivale 2022-08-23 10:04:21 +02:00
parent 275b17be57
commit 16a3794686
3 changed files with 95 additions and 95 deletions

View File

@ -822,9 +822,9 @@ impl<'a> Widget for Bag<'a> {
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&(match inventory.next_sort_order() { &(match inventory.next_sort_order() {
InventorySortOrder::Name => i18n.get("hud.bag.sort_by_name"), InventorySortOrder::Name => i18n.get_msg("hud-bag-sort_by_name"),
InventorySortOrder::Quality => i18n.get("hud.bag.sort_by_quality"), InventorySortOrder::Quality => i18n.get_msg("hudbag-sort_by_quality"),
InventorySortOrder::Tag => i18n.get("hud.bag.sort_by_category"), InventorySortOrder::Tag => i18n.get_msg("hud-bag-sort_by_category"),
}), }),
"", "",
&tooltip, &tooltip,
@ -894,7 +894,7 @@ impl<'a> Widget for Bag<'a> {
} else { } else {
let manager = &mut *self.tooltip_manager; let manager = &mut *self.tooltip_manager;
$slot_maker $slot_maker
.with_tooltip(manager, &i18n.get($desc), "", &tooltip, color::WHITE) .with_tooltip(manager, &i18n.get_msg($desc), "", &tooltip, color::WHITE)
.set($slot_id, ui) .set($slot_id, ui)
} }
}; };
@ -974,18 +974,18 @@ impl<'a> Widget for Bag<'a> {
btn.down_from(state.ids.stat_icons[i.0 - 1], 7.0) btn.down_from(state.ids.stat_icons[i.0 - 1], 7.0)
}; };
let tooltip_head = match i.1 { let tooltip_head = match i.1 {
"Health" => i18n.get("hud.bag.health"), "Health" => i18n.get_msg("hud-bag-health"),
"Energy" => i18n.get("hud.bag.energy"), "Energy" => i18n.get_msg("hud-bag-energy"),
"Combat Rating" => i18n.get("hud.bag.combat_rating"), "Combat Rating" => i18n.get_msg("hud-bag-combat_rating"),
"Protection" => i18n.get("hud.bag.protection"), "Protection" => i18n.get_msg("hud-bag-protection"),
"Stun Resilience" => i18n.get("hud.bag.stun_res"), "Stun Resilience" => i18n.get_msg("hud-bag-stun_res"),
"Stealth" => i18n.get("hud.bag.stealth"), "Stealth" => i18n.get_msg("hud-bag-stealth"),
_ => Cow::Borrowed(""), _ => Cow::Borrowed(""),
}; };
let tooltip_txt = match i.1 { let tooltip_txt = match i.1 {
"Combat Rating" => i18n.get("hud.bag.combat_rating_desc"), "Combat Rating" => i18n.get_msg("hud-bag-combat_rating_desc"),
"Protection" => i18n.get("hud.bag.protection_desc"), "Protection" => i18n.get_msg("hud-bag-protection_desc"),
"Stun Resilience" => i18n.get("hud.bag.stun_res_desc"), "Stun Resilience" => i18n.get_msg("hud-bag-stun_res_desc"),
_ => Cow::Borrowed(""), _ => Cow::Borrowed(""),
}; };
btn.with_tooltip( btn.with_tooltip(
@ -1022,7 +1022,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.head_slot; let slot_id = state.ids.head_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.head"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-head");
// Necklace // Necklace
let item_slot = EquipSlot::Armor(ArmorSlot::Neck); let item_slot = EquipSlot::Armor(ArmorSlot::Neck);
@ -1033,7 +1033,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.neck_slot; let slot_id = state.ids.neck_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.neck"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-neck");
// Chest // Chest
//Image::new(self.imgs.armor_slot) // different graphics for empty/non empty //Image::new(self.imgs.armor_slot) // different graphics for empty/non empty
@ -1045,7 +1045,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.chest_slot; let slot_id = state.ids.chest_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.chest"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-chest");
// Shoulders // Shoulders
let item_slot = EquipSlot::Armor(ArmorSlot::Shoulders); let item_slot = EquipSlot::Armor(ArmorSlot::Shoulders);
@ -1056,7 +1056,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.shoulders_slot; let slot_id = state.ids.shoulders_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.shoulders"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-shoulders");
// Hands // Hands
let item_slot = EquipSlot::Armor(ArmorSlot::Hands); let item_slot = EquipSlot::Armor(ArmorSlot::Hands);
@ -1067,7 +1067,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.hands_slot; let slot_id = state.ids.hands_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.hands"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-hands");
// Belt // Belt
let item_slot = EquipSlot::Armor(ArmorSlot::Belt); let item_slot = EquipSlot::Armor(ArmorSlot::Belt);
@ -1078,7 +1078,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.belt_slot; let slot_id = state.ids.belt_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.belt"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-belt");
// Legs // Legs
let item_slot = EquipSlot::Armor(ArmorSlot::Legs); let item_slot = EquipSlot::Armor(ArmorSlot::Legs);
@ -1089,7 +1089,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.legs_slot; let slot_id = state.ids.legs_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.legs"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-legs");
// Ring // Ring
let item_slot = EquipSlot::Armor(ArmorSlot::Ring1); let item_slot = EquipSlot::Armor(ArmorSlot::Ring1);
@ -1100,7 +1100,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.ring1_slot; let slot_id = state.ids.ring1_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.ring"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-ring");
// Ring 2 // Ring 2
let item_slot = EquipSlot::Armor(ArmorSlot::Ring2); let item_slot = EquipSlot::Armor(ArmorSlot::Ring2);
@ -1111,7 +1111,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.ring2_slot; let slot_id = state.ids.ring2_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.ring"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-ring");
// Back // Back
let item_slot = EquipSlot::Armor(ArmorSlot::Back); let item_slot = EquipSlot::Armor(ArmorSlot::Back);
@ -1122,7 +1122,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.back_slot; let slot_id = state.ids.back_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.back"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-back");
// Foot // Foot
let item_slot = EquipSlot::Armor(ArmorSlot::Feet); let item_slot = EquipSlot::Armor(ArmorSlot::Feet);
@ -1133,7 +1133,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.feet_slot; let slot_id = state.ids.feet_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.feet"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-feet");
// Lantern // Lantern
let item_slot = EquipSlot::Lantern; let item_slot = EquipSlot::Lantern;
@ -1144,7 +1144,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.lantern_slot; let slot_id = state.ids.lantern_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.lantern"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-lantern");
// Glider // Glider
let item_slot = EquipSlot::Glider; let item_slot = EquipSlot::Glider;
@ -1155,7 +1155,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.glider_slot; let slot_id = state.ids.glider_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.glider"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-glider");
// Tabard // Tabard
let item_slot = EquipSlot::Armor(ArmorSlot::Tabard); let item_slot = EquipSlot::Armor(ArmorSlot::Tabard);
@ -1166,7 +1166,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.tabard_slot; let slot_id = state.ids.tabard_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.tabard"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-tabard");
// Active Mainhand/Left-Slot // Active Mainhand/Left-Slot
let item_slot = EquipSlot::ActiveMainhand; let item_slot = EquipSlot::ActiveMainhand;
@ -1177,7 +1177,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.active_mainhand_slot; let slot_id = state.ids.active_mainhand_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.mainhand"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-mainhand");
// Active Offhand/Right-Slot // Active Offhand/Right-Slot
let item_slot = EquipSlot::ActiveOffhand; let item_slot = EquipSlot::ActiveOffhand;
@ -1188,7 +1188,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.active_offhand_slot; let slot_id = state.ids.active_offhand_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.offhand"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-offhand");
// Inactive Mainhand/Left-Slot // Inactive Mainhand/Left-Slot
let item_slot = EquipSlot::InactiveMainhand; let item_slot = EquipSlot::InactiveMainhand;
@ -1199,7 +1199,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.inactive_mainhand_slot; let slot_id = state.ids.inactive_mainhand_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.inactive_mainhand"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-inactive_mainhand");
// Inactive Offhand/Right-Slot // Inactive Offhand/Right-Slot
let item_slot = EquipSlot::InactiveOffhand; let item_slot = EquipSlot::InactiveOffhand;
@ -1210,7 +1210,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.inactive_offhand_slot; let slot_id = state.ids.inactive_offhand_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.inactive_offhand"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-inactive_offhand");
if Button::image(self.imgs.swap_equipped_weapons_btn) if Button::image(self.imgs.swap_equipped_weapons_btn)
.hover_image(self.imgs.swap_equipped_weapons_btn_hover) .hover_image(self.imgs.swap_equipped_weapons_btn_hover)
@ -1220,7 +1220,7 @@ impl<'a> Widget for Bag<'a> {
.align_middle_y_of(state.ids.active_mainhand_slot) .align_middle_y_of(state.ids.active_mainhand_slot)
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&i18n.get("hud.bag.swap_equipped_weapons_title"), &i18n.get_msg("hud-bag-swap_equipped_weapons_title"),
&(if let Some(key) = self &(if let Some(key) = self
.global_state .global_state
.settings .settings
@ -1259,7 +1259,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.bag1_slot; let slot_id = state.ids.bag1_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.bag"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-bag");
// Bag 2 // Bag 2
let item_slot = EquipSlot::Armor(ArmorSlot::Bag2); let item_slot = EquipSlot::Armor(ArmorSlot::Bag2);
@ -1270,7 +1270,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.bag2_slot; let slot_id = state.ids.bag2_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.bag"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-bag");
// Bag 3 // Bag 3
let item_slot = EquipSlot::Armor(ArmorSlot::Bag3); let item_slot = EquipSlot::Armor(ArmorSlot::Bag3);
@ -1281,7 +1281,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.bag3_slot; let slot_id = state.ids.bag3_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.bag"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-bag");
// Bag 4 // Bag 4
let item_slot = EquipSlot::Armor(ArmorSlot::Bag4); let item_slot = EquipSlot::Armor(ArmorSlot::Bag4);
@ -1292,7 +1292,7 @@ impl<'a> Widget for Bag<'a> {
.filled_slot(filled_slot); .filled_slot(filled_slot);
let slot_id = state.ids.bag4_slot; let slot_id = state.ids.bag4_slot;
set_tooltip!(slot, slot_id, item_slot, "hud.bag.bag"); set_tooltip!(slot, slot_id, item_slot, "hud-bag-bag");
// Close button // Close button
if Button::image(self.imgs.close_btn) if Button::image(self.imgs.close_btn)

View File

@ -278,7 +278,7 @@ impl<'a> Widget for Map<'a> {
.set(state.ids.icon, ui); .set(state.ids.icon, ui);
// Map Title // Map Title
Text::new(&i18n.get("hud.map.map_title")) Text::new(&i18n.get_msg("hud-map-map_title"))
.mid_top_with_margin_on(state.ids.frame, 3.0) .mid_top_with_margin_on(state.ids.frame, 3.0)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(29)) .font_size(self.fonts.cyri.scale(29))
@ -286,7 +286,7 @@ impl<'a> Widget for Map<'a> {
.set(state.ids.map_title, ui); .set(state.ids.map_title, ui);
// Questlog Title // Questlog Title
Text::new(&i18n.get("hud.map.qlog_title")) Text::new(&i18n.get_msg("hud-map-qlog_title"))
.mid_top_with_margin_on(state.ids.qlog_align, 6.0) .mid_top_with_margin_on(state.ids.qlog_align, 6.0)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(21)) .font_size(self.fonts.cyri.scale(21))
@ -506,7 +506,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowDifficulty(!show_difficulty))); events.push(Event::SettingsChange(MapShowDifficulty(!show_difficulty)));
} }
Text::new(&i18n.get("hud.map.difficulty")) Text::new(&i18n.get_msg("hud-map-difficulty"))
.right_from(state.ids.show_difficulty_box, 10.0) .right_from(state.ids.show_difficulty_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -540,7 +540,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowTowns(!show_towns))); events.push(Event::SettingsChange(MapShowTowns(!show_towns)));
} }
Text::new(&i18n.get("hud.map.towns")) Text::new(&i18n.get_msg("hud-map-towns"))
.right_from(state.ids.show_towns_box, 10.0) .right_from(state.ids.show_towns_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -574,7 +574,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowCastles(!show_castles))); events.push(Event::SettingsChange(MapShowCastles(!show_castles)));
} }
Text::new(&i18n.get("hud.map.castles")) Text::new(&i18n.get_msg("hud-map-castles"))
.right_from(state.ids.show_castles_box, 10.0) .right_from(state.ids.show_castles_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -608,7 +608,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowDungeons(!show_dungeons))); events.push(Event::SettingsChange(MapShowDungeons(!show_dungeons)));
} }
Text::new(&i18n.get("hud.map.dungeons")) Text::new(&i18n.get_msg("hud-map-dungeons"))
.right_from(state.ids.show_dungeons_box, 10.0) .right_from(state.ids.show_dungeons_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -642,7 +642,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowCaves(!show_caves))); events.push(Event::SettingsChange(MapShowCaves(!show_caves)));
} }
Text::new(&i18n.get("hud.map.caves")) Text::new(&i18n.get_msg("hud-map-caves"))
.right_from(state.ids.show_caves_box, 10.0) .right_from(state.ids.show_caves_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -676,7 +676,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowTrees(!show_trees))); events.push(Event::SettingsChange(MapShowTrees(!show_trees)));
} }
Text::new(&i18n.get("hud.map.trees")) Text::new(&i18n.get_msg("hud-map-trees"))
.right_from(state.ids.show_trees_box, 10.0) .right_from(state.ids.show_trees_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -710,7 +710,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowBiomes(!show_biomes))); events.push(Event::SettingsChange(MapShowBiomes(!show_biomes)));
} }
Text::new(&i18n.get("hud.map.biomes")) Text::new(&i18n.get_msg("hud-map-biomes"))
.right_from(state.ids.show_biomes_box, 10.0) .right_from(state.ids.show_biomes_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -744,7 +744,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowPeaks(!show_peaks))); events.push(Event::SettingsChange(MapShowPeaks(!show_peaks)));
} }
Text::new(&i18n.get("hud.map.peaks")) Text::new(&i18n.get_msg("hud-map-peaks"))
.right_from(state.ids.show_peaks_box, 10.0) .right_from(state.ids.show_peaks_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -781,7 +781,7 @@ impl<'a> Widget for Map<'a> {
{ {
events.push(Event::SettingsChange(MapShowVoxelMap(!show_voxel_map))); events.push(Event::SettingsChange(MapShowVoxelMap(!show_voxel_map)));
} }
Text::new(&i18n.get("hud.map.voxel_map")) Text::new(&i18n.get_msg("hud-map-voxel_map"))
.right_from(state.ids.show_voxel_map_box, 10.0) .right_from(state.ids.show_voxel_map_box, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -872,15 +872,15 @@ impl<'a> Widget for Map<'a> {
.as_deref() .as_deref()
.map(Cow::Borrowed) .map(Cow::Borrowed)
.unwrap_or_else(|| match &site.kind { .unwrap_or_else(|| match &site.kind {
SiteKind::Town => i18n.get("hud.map.town"), SiteKind::Town => i18n.get_msg("hud-map-town"),
SiteKind::Dungeon { .. } => i18n.get("hud.map.dungeon"), SiteKind::Dungeon { .. } => i18n.get_msg("hud-map-dungeon"),
SiteKind::Castle => i18n.get("hud.map.castle"), SiteKind::Castle => i18n.get_msg("hud-map-castle"),
SiteKind::Cave => i18n.get("hud.map.cave"), SiteKind::Cave => i18n.get_msg("hud-map-cave"),
SiteKind::Tree => i18n.get("hud.map.tree"), SiteKind::Tree => i18n.get_msg("hud-map-tree"),
SiteKind::Gnarling => i18n.get("hud.map.gnarling"), SiteKind::Gnarling => i18n.get_msg("hud-map-gnarling"),
}); });
let (difficulty, desc) = match &site.kind { let (difficulty, desc) = match &site.kind {
SiteKind::Town => (None, i18n.get("hud.map.town")), SiteKind::Town => (None, i18n.get_msg("hud-map-town")),
SiteKind::Dungeon { difficulty } => { SiteKind::Dungeon { difficulty } => {
if *difficulty < 5 { if *difficulty < 5 {
( (
@ -898,10 +898,10 @@ impl<'a> Widget for Map<'a> {
) )
} }
}, },
SiteKind::Castle => (None, i18n.get("hud.map.castle")), SiteKind::Castle => (None, i18n.get_msg("hud-map-castle")),
SiteKind::Cave => (None, i18n.get("hud.map.cave")), SiteKind::Cave => (None, i18n.get_msg("hud-map-cave")),
SiteKind::Tree => (None, i18n.get("hud.map.tree")), SiteKind::Tree => (None, i18n.get_msg("hud-map-tree")),
SiteKind::Gnarling => (Some(0), i18n.get("hud.map.gnarling")), SiteKind::Gnarling => (Some(0), i18n.get_msg("hud-map-gnarling")),
}; };
let desc = desc.into_owned() + &get_site_economy(site_rich); let desc = desc.into_owned() + &get_site_economy(site_rich);
let site_btn = Button::image(match &site.kind { let site_btn = Button::image(match &site.kind {
@ -1274,7 +1274,7 @@ impl<'a> Widget for Map<'a> {
.floating(true) .floating(true)
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&i18n.get("hud.map.marked_location"), &i18n.get_msg("hud-map-marked_location"),
&format!( &format!(
"X: {}, Y: {}\n\n{}", "X: {}, Y: {}\n\n{}",
lm.x as i32, lm.x as i32,
@ -1316,12 +1316,12 @@ impl<'a> Widget for Map<'a> {
.floating(true) .floating(true)
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&i18n.get("hud.map.marked_location"), &i18n.get_msg("hud-map-marked_location"),
&format!( &format!(
"X: {}, Y: {}\n\n{}", "X: {}, Y: {}\n\n{}",
lm.x as i32, lm.x as i32,
lm.y as i32, lm.y as i32,
i18n.get("hud.map.marked_location_remove") i18n.get_msg("hud-map-marked_location_remove")
), ),
&site_tooltip, &site_tooltip,
TEXT_VELORITE, TEXT_VELORITE,
@ -1389,7 +1389,7 @@ impl<'a> Widget for Map<'a> {
} else { } else {
self.imgs.button self.imgs.button
}) })
.label(&i18n.get("hud.map.recenter")) .label(&i18n.get_msg("hud-map-recenter"))
.label_y(position::Relative::Scalar(1.0)) .label_y(position::Relative::Scalar(1.0))
.label_color(if recenter { .label_color(if recenter {
TEXT_COLOR TEXT_COLOR
@ -1414,7 +1414,7 @@ impl<'a> Widget for Map<'a> {
.w_h(icon_size.x, icon_size.y) .w_h(icon_size.x, icon_size.y)
.color(Some(UI_HIGHLIGHT_0)) .color(Some(UI_HIGHLIGHT_0))
.set(state.ids.drag_ico, ui); .set(state.ids.drag_ico, ui);
Text::new(&i18n.get("hud.map.drag")) Text::new(&i18n.get_msg("hud-map-drag"))
.right_from(state.ids.drag_ico, 5.0) .right_from(state.ids.drag_ico, 5.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -1426,7 +1426,7 @@ impl<'a> Widget for Map<'a> {
.w_h(icon_size.x, icon_size.y) .w_h(icon_size.x, icon_size.y)
.color(Some(UI_HIGHLIGHT_0)) .color(Some(UI_HIGHLIGHT_0))
.set(state.ids.zoom_ico, ui); .set(state.ids.zoom_ico, ui);
Text::new(&i18n.get("hud.map.zoom")) Text::new(&i18n.get_msg("hud-map-zoom"))
.right_from(state.ids.zoom_ico, 5.0) .right_from(state.ids.zoom_ico, 5.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -1442,7 +1442,7 @@ impl<'a> Widget for Map<'a> {
.color(TEXT_COLOR) .color(TEXT_COLOR)
.set(state.ids.waypoint_binding_txt, ui); .set(state.ids.waypoint_binding_txt, ui);
Text::new(&i18n.get("hud.map.mid_click")) Text::new(&i18n.get_msg("hud-map-mid_click"))
.right_from(state.ids.waypoint_binding_txt, 5.0) .right_from(state.ids.waypoint_binding_txt, 5.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -1458,7 +1458,7 @@ impl<'a> Widget for Map<'a> {
.bottom_right_with_margins_on(state.ids.map_layers[0], -36.0, 0.0) .bottom_right_with_margins_on(state.ids.map_layers[0], -36.0, 0.0)
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&i18n.get("hud.map.change_map_mode"), &i18n.get_msg("hud-map-change_map_mode"),
"", "",
&site_tooltip, &site_tooltip,
TEXT_COLOR, TEXT_COLOR,
@ -1482,8 +1482,8 @@ impl<'a> Widget for Map<'a> {
.left_from(state.ids.map_mode_btn, 5.0) .left_from(state.ids.map_mode_btn, 5.0)
.with_tooltip( .with_tooltip(
self.tooltip_manager, self.tooltip_manager,
&i18n.get("hud.map.toggle_minimap_voxel"), &i18n.get_msg("hud-map-toggle_minimap_voxel"),
&i18n.get("hud.map.zoom_minimap_explanation"), &i18n.get_msg("hud-map-zoom_minimap_explanation"),
&site_tooltip, &site_tooltip,
TEXT_COLOR, TEXT_COLOR,
) )

View File

@ -1640,13 +1640,13 @@ impl Hud {
.mid_top_with_margin_on(self.ids.player_rank_up, fontsize.1) .mid_top_with_margin_on(self.ids.player_rank_up, fontsize.1)
.set(self.ids.player_rank_up_txt_number, ui_widgets); .set(self.ids.player_rank_up_txt_number, ui_widgets);
// Static "New Rank!" text // Static "New Rank!" text
Text::new(&i18n.get("hud.rank_up")) Text::new(&i18n.get_msg("hud-rank_up"))
.font_size(40) .font_size(40)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade)) .color(Color::Rgba(0.0, 0.0, 0.0, fade))
.mid_bottom_with_margin_on(self.ids.player_rank_up, 20.0) .mid_bottom_with_margin_on(self.ids.player_rank_up, 20.0)
.set(self.ids.player_rank_up_txt_0_bg, ui_widgets); .set(self.ids.player_rank_up_txt_0_bg, ui_widgets);
Text::new(&i18n.get("hud.rank_up")) Text::new(&i18n.get_msg("hud-rank_up"))
.font_size(40) .font_size(40)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(1.0, 1.0, 1.0, fade)) .color(Color::Rgba(1.0, 1.0, 1.0, fade))
@ -1654,14 +1654,14 @@ impl Hud {
.set(self.ids.player_rank_up_txt_0, ui_widgets); .set(self.ids.player_rank_up_txt_0, ui_widgets);
// Variable skilltree text // Variable skilltree text
let skill = match display.skill_tree { let skill = match display.skill_tree {
General => i18n.get("common.weapons.general"), General => i18n.get_msg("common-weapons-general"),
Weapon(ToolKind::Hammer) => i18n.get("common.weapons.hammer"), Weapon(ToolKind::Hammer) => i18n.get_msg("common-weapons-hammer"),
Weapon(ToolKind::Axe) => i18n.get("common.weapons.axe"), Weapon(ToolKind::Axe) => i18n.get_msg("common-weapons-axe"),
Weapon(ToolKind::Sword) => i18n.get("common.weapons.sword"), Weapon(ToolKind::Sword) => i18n.get_msg("common-weapons-sword"),
Weapon(ToolKind::Sceptre) => i18n.get("common.weapons.sceptre"), Weapon(ToolKind::Sceptre) => i18n.get_msg("common-weapons-sceptre"),
Weapon(ToolKind::Bow) => i18n.get("common.weapons.bow"), Weapon(ToolKind::Bow) => i18n.get_msg("common-weapons-bow"),
Weapon(ToolKind::Staff) => i18n.get("common.weapons.staff"), Weapon(ToolKind::Staff) => i18n.get_msg("common-weapons-staff"),
Weapon(ToolKind::Pick) => i18n.get("common.tool.mining"), Weapon(ToolKind::Pick) => i18n.get_msg("common-tool-mining"),
_ => Cow::Borrowed("Unknown"), _ => Cow::Borrowed("Unknown"),
}; };
Text::new(&skill) Text::new(&skill)
@ -1720,7 +1720,7 @@ impl Hud {
1.0 1.0
}; };
Text::new(&i18n.get("hud.sct.block")) Text::new(&i18n.get_msg("hud-sct-block"))
.font_size(font_size) .font_size(font_size)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade)) .color(Color::Rgba(0.0, 0.0, 0.0, fade))
@ -1729,7 +1729,7 @@ impl Hud {
ui_widgets.win_h * (-0.3) + y - 3.0, ui_widgets.win_h * (-0.3) + y - 3.0,
) )
.set(player_sct_bg_id, ui_widgets); .set(player_sct_bg_id, ui_widgets);
Text::new(&i18n.get("hud.sct.block")) Text::new(&i18n.get_msg("hud-sct-block"))
.font_size(font_size) .font_size(font_size)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.69, 0.82, 0.88, fade)) .color(Color::Rgba(0.69, 0.82, 0.88, fade))
@ -1823,7 +1823,7 @@ impl Hud {
pickup_failed_pulse: self.failed_entity_pickups.get(&entity).cloned(), pickup_failed_pulse: self.failed_entity_pickups.get(&entity).cloned(),
}, },
&self.fonts, &self.fonts,
vec![(GameInput::Interact, i18n.get("hud.pick_up").to_string())], vec![(GameInput::Interact, i18n.get_msg("hud-pick_up").to_string())],
) )
.set(overitem_id, ui_widgets); .set(overitem_id, ui_widgets);
} }
@ -1858,7 +1858,7 @@ impl Hud {
overitem_properties, overitem_properties,
self.pulse, self.pulse,
&global_state.window.key_layout, &global_state.window.key_layout,
vec![(GameInput::Interact, i18n.get("hud.open").to_string())], vec![(GameInput::Interact, i18n.get_msg("hud-open").to_string())],
) )
.x_y(0.0, 100.0) .x_y(0.0, 100.0)
.position_ingame(over_pos) .position_ingame(over_pos)
@ -1872,13 +1872,13 @@ impl Hud {
&self.fonts, &self.fonts,
match interaction { match interaction {
Interaction::Collect => { Interaction::Collect => {
vec![(GameInput::Interact, i18n.get("hud.collect").to_string())] vec![(GameInput::Interact, i18n.get_msg("hud-collect").to_string())]
}, },
Interaction::Craft(_) => { Interaction::Craft(_) => {
vec![(GameInput::Interact, i18n.get("hud.use").to_string())] vec![(GameInput::Interact, i18n.get_msg("hud-use").to_string())]
}, },
Interaction::Mine => { Interaction::Mine => {
vec![(GameInput::Primary, i18n.get("hud.mine").to_string())] vec![(GameInput::Primary, i18n.get_msg("hud-mine").to_string())]
}, },
}, },
) )
@ -1895,7 +1895,7 @@ impl Hud {
overitem_properties, overitem_properties,
self.pulse, self.pulse,
&global_state.window.key_layout, &global_state.window.key_layout,
vec![(GameInput::Interact, i18n.get("hud.use").to_string())], vec![(GameInput::Interact, i18n.get_msg("hud-use").to_string())],
) )
.x_y(0.0, 100.0) .x_y(0.0, 100.0)
.position_ingame(over_pos) .position_ingame(over_pos)
@ -1928,7 +1928,7 @@ impl Hud {
let over_pos = pos + Vec3::unit_z() * 1.5; let over_pos = pos + Vec3::unit_z() * 1.5;
overitem::Overitem::new( overitem::Overitem::new(
i18n.get("hud.crafting.campfire"), i18n.get_msg("hud-crafting-campfire"),
overitem::TEXT_COLOR, overitem::TEXT_COLOR,
pos.distance_squared(player_pos), pos.distance_squared(player_pos),
&self.fonts, &self.fonts,
@ -1937,7 +1937,7 @@ impl Hud {
overitem_properties, overitem_properties,
self.pulse, self.pulse,
&global_state.window.key_layout, &global_state.window.key_layout,
vec![(GameInput::Interact, i18n.get("hud.sit").to_string())], vec![(GameInput::Interact, i18n.get_msg("hud-sit").to_string())],
) )
.x_y(0.0, 100.0) .x_y(0.0, 100.0)
.position_ingame(over_pos) .position_ingame(over_pos)
@ -2100,8 +2100,8 @@ impl Hud {
== Some(entity) => == Some(entity) =>
{ {
vec![ vec![
(GameInput::Interact, i18n.get("hud.talk").to_string()), (GameInput::Interact, i18n.get_msg("hud-talk").to_string()),
(GameInput::Trade, i18n.get("hud.trade").to_string()), (GameInput::Trade, i18n.get_msg("hud-trade").to_string()),
] ]
}, },
Some(comp::Alignment::Owned(owner)) Some(comp::Alignment::Owned(owner))
@ -2111,7 +2111,7 @@ impl Hud {
&& is_mountable(body, bodies.get(client.entity())) && is_mountable(body, bodies.get(client.entity()))
&& dist_sqr < common::consts::MAX_MOUNT_RANGE.powi(2) => && dist_sqr < common::consts::MAX_MOUNT_RANGE.powi(2) =>
{ {
vec![(GameInput::Mount, i18n.get("hud.mount").to_string())] vec![(GameInput::Mount, i18n.get_msg("hud-mount").to_string())]
}, },
_ => Vec::new(), _ => Vec::new(),
}, },
@ -3306,14 +3306,14 @@ impl Hud {
// Auto walk indicator // Auto walk indicator
if self.show.auto_walk { if self.show.auto_walk {
Text::new(&i18n.get("hud.auto_walk_indicator")) Text::new(&i18n.get_msg("hud-auto_walk_indicator"))
.color(TEXT_BG) .color(TEXT_BG)
.mid_top_with_margin_on(ui_widgets.window, indicator_offset) .mid_top_with_margin_on(ui_widgets.window, indicator_offset)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20)) .font_size(self.fonts.cyri.scale(20))
.set(self.ids.auto_walk_bg, ui_widgets); .set(self.ids.auto_walk_bg, ui_widgets);
indicator_offset += 30.0; indicator_offset += 30.0;
Text::new(&i18n.get("hud.auto_walk_indicator")) Text::new(&i18n.get_msg("hud-auto_walk_indicator"))
.color(KILL_COLOR) .color(KILL_COLOR)
.top_left_with_margins_on(self.ids.auto_walk_bg, -1.0, -1.0) .top_left_with_margins_on(self.ids.auto_walk_bg, -1.0, -1.0)
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
@ -3763,7 +3763,7 @@ impl Hud {
.hover_image(self.imgs.button_hover) .hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press) .press_image(self.imgs.button_press)
.bottom_left_with_margins_on(ui_widgets.window, 350.0, 150.0) .bottom_left_with_margins_on(ui_widgets.window, 350.0, 150.0)
.label(&i18n.get("hud.tutorial_btn")) .label(&i18n._msg("hud-tutorial_btn"))
.label_font_id(self.fonts.cyri.conrod_id) .label_font_id(self.fonts.cyri.conrod_id)
.label_font_size(self.fonts.cyri.scale(18)) .label_font_size(self.fonts.cyri.scale(18))
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)
@ -3811,7 +3811,7 @@ impl Hud {
Intro::Show => { Intro::Show => {
if self.show.intro { if self.show.intro {
self.show.want_grab = false; self.show.want_grab = false;
let quest_headline = i18n.get("hud.temp_quest_headline"); let quest_headline = i18n.get_msg("hud-temp_quest_headline");
let quest_text = i18n.get("hud.temp_quest_text"); let quest_text = i18n.get("hud.temp_quest_text");
Image::new(self.imgs.quest_bg) Image::new(self.imgs.quest_bg)
.w_h(404.0, 858.0) .w_h(404.0, 858.0)