finished first pass removing i18n.get

This commit is contained in:
parzivale 2022-08-23 11:17:21 +02:00
parent 16a3794686
commit 9e22ae01a0
13 changed files with 392 additions and 392 deletions

View File

@ -436,7 +436,7 @@ impl<'a> Widget for Diary<'a> {
}
// Title
Text::new(&self.localized_strings.get("hud.diary"))
Text::new(&self.localized_strings.get_msg("hud-diary"))
.mid_top_with_margin_on(state.ids.frame, 3.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(29))
@ -632,7 +632,7 @@ impl<'a> Widget for Diary<'a> {
};
let tooltip_txt = if locked {
self.localized_strings.get("hud.skill.not_unlocked")
self.localized_strings.get_msg("hud-skill-not_unlocked")
} else {
Cow::Borrowed("")
};
@ -1334,7 +1334,7 @@ impl<'a> Diary<'a> {
ui: &mut UiCell,
mut events: Vec<Event>,
) -> Vec<Event> {
let tree_title = &self.localized_strings.get("common.weapons.general");
let tree_title = &self.localized_strings.get_msg("common-weapons-general");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
.font_id(self.fonts.cyri.conrod_id)
@ -1440,8 +1440,8 @@ impl<'a> Diary<'a> {
},
// Bottom left skills
SkillIcon::Descriptive {
title: "hud.skill.dodge_title",
desc: "hud.skill.dodge",
title: "hud-skill-dodge_title",
desc: "hud-skill-dodge",
image: self.imgs.skill_dodge_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[0], 3.0),
id: state.ids.skill_general_roll_0,
@ -1466,8 +1466,8 @@ impl<'a> Diary<'a> {
},
// Bottom right skills
SkillIcon::Descriptive {
title: "hud.skill.climbing_title",
desc: "hud.skill.climbing",
title: "hud-skill-climbing_title",
desc: "hud-skill-climbing",
image: self.imgs.skill_climbing_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_r[0], 3.0),
id: state.ids.skill_general_climb_0,
@ -1485,8 +1485,8 @@ impl<'a> Diary<'a> {
id: state.ids.skill_general_climb_2,
},
SkillIcon::Descriptive {
title: "hud.skill.swim_title",
desc: "hud.skill.swim",
title: "hud-skill-swim_title",
desc: "hud-skill-swim",
image: self.imgs.skill_swim_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_r[3], 3.0),
id: state.ids.skill_general_swim_0,
@ -1511,7 +1511,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.sword");
let tree_title = &self.localized_strings.get_msg("common-weapons-sword");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -1556,8 +1556,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.sw_trip_str_title",
desc: "hud.skill.sw_trip_str",
title: "hud-skill-sw_trip_str_title",
desc: "hud-skill-sw_trip_str",
image: self.imgs.twohsword_m1,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_sword_combo_0,
@ -1588,8 +1588,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.sw_dash_title",
desc: "hud.skill.sw_dash",
title: "hud-skill-sw_dash_title",
desc: "hud-skill-sw_dash",
image: self.imgs.twohsword_m2,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_sword_dash_0,
@ -1682,7 +1682,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.hammer");
let tree_title = &self.localized_strings.get_msg("common-weapons-hammer");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -1727,8 +1727,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.hmr_single_strike_title",
desc: "hud.skill.hmr_single_strike",
title: "hud-skill-hmr_single_strike_title",
desc: "hud-skill-hmr_single_strike",
image: self.imgs.twohhammer_m1,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_hammer_combo_0,
@ -1759,8 +1759,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.hmr_charged_melee_title",
desc: "hud.skill.hmr_charged_melee",
title: "hud-skill-hmr_charged_melee_title",
desc: "hud-skill-hmr_charged_melee",
image: self.imgs.hammergolf,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_hammer_charged_0,
@ -1840,7 +1840,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.axe");
let tree_title = &self.localized_strings.get_msg("common-weapons-axe");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -1885,8 +1885,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.axe_double_strike_title",
desc: "hud.skill.axe_double_strike",
title: "hud-skill-axe_double_strike_title",
desc: "hud-skill-axe_double_strike",
image: self.imgs.twohaxe_m1,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_axe_combo_0,
@ -1917,8 +1917,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.axe_spin_title",
desc: "hud.skill.axe_spin",
title: "hud-skill-axe_spin_title",
desc: "hud-skill-axe_spin",
image: self.imgs.axespin,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_axe_spin_0,
@ -1998,7 +1998,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.sceptre");
let tree_title = &self.localized_strings.get_msg("common-weapons-sceptre");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -2043,8 +2043,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.sc_lifesteal_title",
desc: "hud.skill.sc_lifesteal",
title: "hud-skill-sc_lifesteal_title",
desc: "hud-skill-sc_lifesteal",
image: self.imgs.skill_sceptre_lifesteal,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_sceptre_lifesteal_0,
@ -2075,8 +2075,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.sc_heal_title",
desc: "hud.skill.sc_heal",
title: "hud-skill-sc_heal_title",
desc: "hud-skill-sc_heal",
image: self.imgs.skill_sceptre_heal,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_sceptre_heal_0,
@ -2150,7 +2150,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.bow");
let tree_title = &self.localized_strings.get_msg("common-weapons-bow");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -2194,8 +2194,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.bow_charged_title",
desc: "hud.skill.bow_charged",
title: "hud-skill-bow_charged_title",
desc: "hud-skill-bow_charged",
image: self.imgs.bow_m1,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_bow_charged_0,
@ -2232,8 +2232,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.bow_repeater_title",
desc: "hud.skill.bow_repeater",
title: "hud-skill-bow_repeater_title",
desc: "hud-skill-bow_repeater",
image: self.imgs.bow_m2,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_bow_repeater_0,
@ -2308,7 +2308,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.weapons.staff");
let tree_title = &self.localized_strings.get_msg("common-weapons-staff");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -2354,8 +2354,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.st_fireball_title",
desc: "hud.skill.st_fireball",
title: "hud-skill-st_fireball_title",
desc: "hud-skill-st_fireball",
image: self.imgs.fireball,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_staff_basic_0,
@ -2380,8 +2380,8 @@ impl<'a> Diary<'a> {
},
// Top right skills
SkillIcon::Descriptive {
title: "hud.skill.st_flamethrower_title",
desc: "hud.skill.st_flamethrower",
title: "hud-skill-st_flamethrower_title",
desc: "hud-skill-st_flamethrower",
image: self.imgs.flamethrower,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_staff_beam_0,
@ -2455,7 +2455,7 @@ impl<'a> Diary<'a> {
mut events: Vec<Event>,
) -> Vec<Event> {
// Title text
let tree_title = &self.localized_strings.get("common.tool.mining");
let tree_title = &self.localized_strings.get_msg("common-tool-mining");
Text::new(tree_title)
.mid_top_with_margin_on(state.ids.content_align, 2.0)
@ -2501,8 +2501,8 @@ impl<'a> Diary<'a> {
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud.skill.pick_strike_title",
desc: "hud.skill.pick_strike",
title: "hud-skill-pick_strike_title",
desc: "hud-skill-pick_strike",
image: self.imgs.pickaxe,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_pick_m1,
@ -2553,8 +2553,8 @@ impl<'a> Diary<'a> {
.position(*position)
.with_tooltip(
self.tooltip_manager,
&self.localized_strings.get(title),
&self.localized_strings.get(desc),
&self.localized_strings.get_msg(title),
&self.localized_strings.get_msg(desc),
diary_tooltip,
TEXT_COLOR,
)
@ -2793,13 +2793,13 @@ fn skill_strings(skill: Skill) -> SkillStrings<'static> {
fn general_skill_strings(skill: GeneralSkill) -> SkillStrings<'static> {
match skill {
GeneralSkill::HealthIncrease => SkillStrings::with_const(
"hud.skill.inc_health_title",
"hud.skill.inc_health",
"hud-skill-inc_health_title",
"hud-skill-inc_health",
u32::from(HP_PER_LEVEL),
),
GeneralSkill::EnergyIncrease => SkillStrings::with_const(
"hud.skill.inc_energy_title",
"hud.skill.inc_energy",
"hud-skill-inc_energy_title",
"hud-skill-inc_energy",
u32::from(ENERGY_PER_LEVEL),
),
}
@ -2808,22 +2808,22 @@ fn general_skill_strings(skill: GeneralSkill) -> SkillStrings<'static> {
fn unlock_skill_strings(group: SkillGroupKind) -> SkillStrings<'static> {
match group {
SkillGroupKind::Weapon(ToolKind::Sword) => {
SkillStrings::plain("hud.skill.unlck_sword_title", "hud.skill.unlck_sword")
SkillStrings::plain("hud-skill-unlck_sword_title", "hud-skill-unlck_sword")
},
SkillGroupKind::Weapon(ToolKind::Axe) => {
SkillStrings::plain("hud.skill.unlck_axe_title", "hud.skill.unlck_axe")
SkillStrings::plain("hud-skill-unlck_axe_title", "hud-skill-unlck_axe")
},
SkillGroupKind::Weapon(ToolKind::Hammer) => {
SkillStrings::plain("hud.skill.unlck_hammer_title", "hud.skill.unlck_hammer")
SkillStrings::plain("hud-skill-unlck_hammer_title", "hud-skill-unlck_hammer")
},
SkillGroupKind::Weapon(ToolKind::Bow) => {
SkillStrings::plain("hud.skill.unlck_bow_title", "hud.skill.unlck_bow")
SkillStrings::plain("hud-skill-unlck_bow_title", "hud-skill-unlck_bow")
},
SkillGroupKind::Weapon(ToolKind::Staff) => {
SkillStrings::plain("hud.skill.unlck_staff_title", "hud.skill.unlck_staff")
SkillStrings::plain("hud-skill-unlck_staff_title", "hud-skill-unlck_staff")
},
SkillGroupKind::Weapon(ToolKind::Sceptre) => {
SkillStrings::plain("hud.skill.unlck_sceptre_title", "hud.skill.unlck_sceptre")
SkillStrings::plain("hud-skill-unlck_sceptre_title", "hud-skill-unlck_sceptre")
},
SkillGroupKind::General
| SkillGroupKind::Weapon(
@ -2848,77 +2848,77 @@ fn sword_skill_strings(skill: SwordSkill) -> SkillStrings<'static> {
match skill {
// triple strike
SwordSkill::TsCombo => SkillStrings::plain(
"hud.skill.sw_trip_str_combo_title",
"hud.skill.sw_trip_str_combo",
"hud-skill-sw_trip_str_combo_title",
"hud-skill-sw_trip_str_combo",
),
SwordSkill::TsDamage => SkillStrings::plain(
"hud.skill.sw_trip_str_dmg_title",
"hud.skill.sw_trip_str_dmg",
"hud-skill-sw_trip_str_dmg_title",
"hud-skill-sw_trip_str_dmg",
),
SwordSkill::TsSpeed => {
SkillStrings::plain("hud.skill.sw_trip_str_sp_title", "hud.skill.sw_trip_str_sp")
SkillStrings::plain("hud-skill-sw_trip_str_sp_title", "hud-skill-sw_trip_str_sp")
},
SwordSkill::TsRegen => SkillStrings::plain(
"hud.skill.sw_trip_str_reg_title",
"hud.skill.sw_trip_str_reg",
"hud-skill-sw_trip_str_reg_title",
"hud-skill-sw_trip_str_reg",
),
// dash
SwordSkill::DDamage => SkillStrings::with_mult(
"hud.skill.sw_dash_dmg_title",
"hud.skill.sw_dash_dmg",
"hud-skill-sw_dash_dmg_title",
"hud-skill-sw_dash_dmg",
modifiers.dash.base_damage,
),
SwordSkill::DDrain => SkillStrings::with_mult(
"hud.skill.sw_dash_drain_title",
"hud.skill.sw_dash_drain",
"hud-skill-sw_dash_drain_title",
"hud-skill-sw_dash_drain",
modifiers.dash.energy_drain,
),
SwordSkill::DCost => SkillStrings::with_mult(
"hud.skill.sw_dash_cost_title",
"hud.skill.sw_dash_cost",
"hud-skill-sw_dash_cost_title",
"hud-skill-sw_dash_cost",
modifiers.dash.energy_cost,
),
SwordSkill::DSpeed => SkillStrings::with_mult(
"hud.skill.sw_dash_speed_title",
"hud.skill.sw_dash_speed",
"hud-skill-sw_dash_speed_title",
"hud-skill-sw_dash_speed",
modifiers.dash.forward_speed,
),
SwordSkill::DChargeThrough => SkillStrings::plain(
"hud.skill.sw_dash_charge_through_title",
"hud.skill.sw_dash_charge_through",
"hud-skill-sw_dash_charge_through_title",
"hud-skill-sw_dash_charge_through",
),
SwordSkill::DScaling => SkillStrings::with_mult(
"hud.skill.sw_dash_scale_title",
"hud.skill.sw_dash_scale",
"hud-skill-sw_dash_scale_title",
"hud-skill-sw_dash_scale",
modifiers.dash.scaled_damage,
),
// spin
SwordSkill::UnlockSpin => {
SkillStrings::plain("hud.skill.sw_spin_title", "hud.skill.sw_spin")
SkillStrings::plain("hud-skill-sw_spin_title", "hud-skill-sw_spin")
},
SwordSkill::SDamage => SkillStrings::with_mult(
"hud.skill.sw_spin_dmg_title",
"hud.skill.sw_spin_dmg",
"hud-skill-sw_spin_dmg_title",
"hud-skill-sw_spin_dmg",
modifiers.spin.base_damage,
),
SwordSkill::SSpeed => SkillStrings::with_mult(
"hud.skill.sw_spin_spd_title",
"hud.skill.sw_spin_spd",
"hud-skill-sw_spin_spd_title",
"hud-skill-sw_spin_spd",
modifiers.spin.swing_duration,
),
SwordSkill::SCost => SkillStrings::with_mult(
"hud.skill.sw_spin_cost_title",
"hud.skill.sw_spin_cost",
"hud-skill-sw_spin_cost_title",
"hud-skill-sw_spin_cost",
modifiers.spin.energy_cost,
),
SwordSkill::SSpins => SkillStrings::with_const(
"hud.skill.sw_spin_spins_title",
"hud.skill.sw_spin_spins",
"hud-skill-sw_spin_spins_title",
"hud-skill-sw_spin_spins",
modifiers.spin.num,
),
// independent skills
SwordSkill::InterruptingAttacks => {
SkillStrings::plain("hud.skill.sw_interrupt_title", "hud.skill.sw_interrupt")
SkillStrings::plain("hud-skill-sw_interrupt_title", "hud-skill-sw_interrupt")
},
}
}
@ -2928,68 +2928,68 @@ fn axe_skill_strings(skill: AxeSkill) -> SkillStrings<'static> {
match skill {
// Double strike upgrades
AxeSkill::DsCombo => SkillStrings::plain(
"hud.skill.axe_double_strike_combo_title",
"hud.skill.axe_double_strike_combo",
"hud-skill-axe_double_strike_combo_title",
"hud-skill-axe_double_strike_combo",
),
AxeSkill::DsDamage => SkillStrings::plain(
"hud.skill.axe_double_strike_damage_title",
"hud.skill.axe_double_strike_damage",
"hud-skill-axe_double_strike_damage_title",
"hud-skill-axe_double_strike_damage",
),
AxeSkill::DsSpeed => SkillStrings::plain(
"hud.skill.axe_double_strike_speed_title",
"hud.skill.axe_double_strike_speed",
"hud-skill-axe_double_strike_speed_title",
"hud-skill-axe_double_strike_speed",
),
AxeSkill::DsRegen => SkillStrings::plain(
"hud.skill.axe_double_strike_regen_title",
"hud.skill.axe_double_strike_regen",
"hud-skill-axe_double_strike_regen_title",
"hud-skill-axe_double_strike_regen",
),
// Spin upgrades
AxeSkill::SInfinite => SkillStrings::plain(
"hud.skill.axe_infinite_axe_spin_title",
"hud.skill.axe_infinite_axe_spin",
"hud-skill-axe_infinite_axe_spin_title",
"hud-skill-axe_infinite_axe_spin",
),
AxeSkill::SHelicopter => SkillStrings::plain(
"hud.skill.axe_spin_helicopter_title",
"hud.skill.axe_spin_helicopter",
"hud-skill-axe_spin_helicopter_title",
"hud-skill-axe_spin_helicopter",
),
AxeSkill::SDamage => SkillStrings::with_mult(
"hud.skill.axe_spin_damage_title",
"hud.skill.axe_spin_damage",
"hud-skill-axe_spin_damage_title",
"hud-skill-axe_spin_damage",
modifiers.spin.base_damage,
),
AxeSkill::SSpeed => SkillStrings::with_mult(
"hud.skill.axe_spin_speed_title",
"hud.skill.axe_spin_speed",
"hud-skill-axe_spin_speed_title",
"hud-skill-axe_spin_speed",
modifiers.spin.swing_duration,
),
AxeSkill::SCost => SkillStrings::with_mult(
"hud.skill.axe_spin_cost_title",
"hud.skill.axe_spin_cost",
"hud-skill-axe_spin_cost_title",
"hud-skill-axe_spin_cost",
modifiers.spin.energy_cost,
),
// Leap upgrades
AxeSkill::UnlockLeap => SkillStrings::plain(
"hud.skill.axe_unlock_leap_title",
"hud.skill.axe_unlock_leap",
"hud-skill-axe_unlock_leap_title",
"hud-skill-axe_unlock_leap",
),
AxeSkill::LDamage => SkillStrings::with_mult(
"hud.skill.axe_leap_damage_title",
"hud.skill.axe_leap_damage",
"hud-skill-axe_leap_damage_title",
"hud-skill-axe_leap_damage",
modifiers.leap.base_damage,
),
AxeSkill::LKnockback => SkillStrings::with_mult(
"hud.skill.axe_leap_knockback_title",
"hud.skill.axe_leap_knockback",
"hud-skill-axe_leap_knockback_title",
"hud-skill-axe_leap_knockback",
modifiers.leap.knockback,
),
AxeSkill::LCost => SkillStrings::with_mult(
"hud.skill.axe_leap_cost_title",
"hud.skill.axe_leap_cost",
"hud-skill-axe_leap_cost_title",
"hud-skill-axe_leap_cost",
modifiers.leap.energy_cost,
),
AxeSkill::LDistance => SkillStrings::with_mult(
"hud.skill.axe_leap_distance_title",
"hud.skill.axe_leap_distance",
"hud-skill-axe_leap_distance_title",
"hud-skill-axe_leap_distance",
modifiers.leap.leap_strength,
),
}
@ -3000,71 +3000,71 @@ fn hammer_skill_strings(skill: HammerSkill) -> SkillStrings<'static> {
// Single strike upgrades
match skill {
HammerSkill::SsKnockback => SkillStrings::with_mult(
"hud.skill.hmr_single_strike_knockback_title",
"hud.skill.hmr_single_strike_knockback",
"hud-skill-hmr_single_strike_knockback_title",
"hud-skill-hmr_single_strike_knockback",
modifiers.single_strike.knockback,
),
HammerSkill::SsDamage => SkillStrings::plain(
"hud.skill.hmr_single_strike_damage_title",
"hud.skill.hmr_single_strike_damage",
"hud-skill-hmr_single_strike_damage_title",
"hud-skill-hmr_single_strike_damage",
),
HammerSkill::SsSpeed => SkillStrings::plain(
"hud.skill.hmr_single_strike_speed_title",
"hud.skill.hmr_single_strike_speed",
"hud-skill-hmr_single_strike_speed_title",
"hud-skill-hmr_single_strike_speed",
),
HammerSkill::SsRegen => SkillStrings::plain(
"hud.skill.hmr_single_strike_regen_title",
"hud.skill.hmr_single_strike_regen",
"hud-skill-hmr_single_strike_regen_title",
"hud-skill-hmr_single_strike_regen",
),
// Charged melee upgrades
HammerSkill::CDamage => SkillStrings::with_mult(
"hud.skill.hmr_charged_melee_damage_title",
"hud.skill.hmr_charged_melee_damage",
"hud-skill-hmr_charged_melee_damage_title",
"hud-skill-hmr_charged_melee_damage",
modifiers.charged.scaled_damage,
),
HammerSkill::CKnockback => SkillStrings::with_mult(
"hud.skill.hmr_charged_melee_knockback_title",
"hud.skill.hmr_charged_melee_knockback",
"hud-kill-hmr_charged_melee_knockback_title",
"hud-skill-hmr_charged_melee_knockback",
modifiers.charged.scaled_knockback,
),
HammerSkill::CDrain => SkillStrings::with_mult(
"hud.skill.hmr_charged_melee_nrg_drain_title",
"hud.skill.hmr_charged_melee_nrg_drain",
"hud-skill-hmr_charged_melee_nrg_drain_title",
"hud-skill-hmr_charged_melee_nrg_drain",
modifiers.charged.energy_drain,
),
HammerSkill::CSpeed => SkillStrings::with_mult(
"hud.skill.hmr_charged_rate_title",
"hud.skill.hmr_charged_rate",
"hud-skill-hmr_charged_rate_title",
"hud-skill-hmr_charged_rate",
modifiers.charged.charge_rate,
),
// Leap upgrades
HammerSkill::UnlockLeap => SkillStrings::plain(
"hud.skill.hmr_unlock_leap_title",
"hud.skill.hmr_unlock_leap",
"hud-skill-hmr_unlock_leap_title",
"hud-skill-hmr_unlock_leap",
),
HammerSkill::LDamage => SkillStrings::with_mult(
"hud.skill.hmr_leap_damage_title",
"hud.skill.hmr_leap_damage",
"hud-skill-hmr_leap_damage_title",
"hud-skill-hmr_leap_damage",
modifiers.leap.base_damage,
),
HammerSkill::LCost => SkillStrings::with_mult(
"hud.skill.hmr_leap_cost_title",
"hud.skill.hmr_leap_cost",
"hud-skill-hmr_leap_cost_title",
"hud-skill-hmr_leap_cost",
modifiers.leap.energy_cost,
),
HammerSkill::LDistance => SkillStrings::with_mult(
"hud.skill.hmr_leap_distance_title",
"hud.skill.hmr_leap_distance",
"hud-skill-hmr_leap_distance_title",
"hud-skill-hmr_leap_distance",
modifiers.leap.leap_strength,
),
HammerSkill::LKnockback => SkillStrings::with_mult(
"hud.skill.hmr_leap_knockback_title",
"hud.skill.hmr_leap_knockback",
"hud-skill-hmr_leap_knockback_title",
"hud-skill-hmr_leap_knockback",
modifiers.leap.knockback,
),
HammerSkill::LRange => SkillStrings::with_const_float(
"hud.skill.hmr_leap_radius_title",
"hud.skill.hmr_leap_radius",
"hud-skill-hmr_leap_radius_title",
"hud-skill-hmr_leap_radius",
modifiers.leap.range,
),
}
@ -3075,75 +3075,75 @@ fn bow_skill_strings(skill: BowSkill) -> SkillStrings<'static> {
match skill {
// Passives
BowSkill::ProjSpeed => SkillStrings::with_mult(
"hud.skill.bow_projectile_speed_title",
"hud.skill.bow_projectile_speed",
"hud-skill-bow_projectile_speed_title",
"hud-skill-bow_projectile_speed",
modifiers.universal.projectile_speed,
),
// Charged upgrades
BowSkill::CDamage => SkillStrings::with_mult(
"hud.skill.bow_charged_damage_title",
"hud.skill.bow_charged_damage",
"hud-skill-bow_charged_damage_title",
"hud-skill-bow_charged_damage",
modifiers.charged.damage_scaling,
),
BowSkill::CRegen => SkillStrings::with_mult(
"hud.skill.bow_charged_energy_regen_title",
"hud.skill.bow_charged_energy_regen",
"hud-skill-bow_charged_energy_regen_title",
"hud-skill-bow_charged_energy_regen",
modifiers.charged.regen_scaling,
),
BowSkill::CKnockback => SkillStrings::with_mult(
"hud.skill.bow_charged_knockback_title",
"hud.skill.bow_charged_knockback",
"hud-skill-bow_charged_knockback_title",
"hud-skill-bow_charged_knockback",
modifiers.charged.knockback_scaling,
),
BowSkill::CSpeed => SkillStrings::with_mult(
"hud.skill.bow_charged_speed_title",
"hud.skill.bow_charged_speed",
"hud-skill-bow_charged_speed_title",
"hud-skill-bow_charged_speed",
modifiers.charged.charge_rate,
),
BowSkill::CMove => SkillStrings::with_mult(
"hud.skill.bow_charged_move_title",
"hud.skill.bow_charged_move",
"hud-skill-bow_charged_move_title",
"hud-skill-bow_charged_move",
modifiers.charged.move_speed,
),
// Repeater upgrades
BowSkill::RDamage => SkillStrings::with_mult(
"hud.skill.bow_repeater_damage_title",
"hud.skill.bow_repeater_damage",
"hud-skill-bow_repeater_damage_title",
"hud-skill-bow_repeater_damage",
modifiers.repeater.power,
),
BowSkill::RCost => SkillStrings::with_mult(
"hud.skill.bow_repeater_cost_title",
"hud.skill.bow_repeater_cost",
"hud-skill-bow_repeater_cost_title",
"hud-skill-bow_repeater_cost",
modifiers.repeater.energy_cost,
),
BowSkill::RSpeed => SkillStrings::with_mult(
"hud.skill.bow_repeater_speed_title",
"hud.skill.bow_repeater_speed",
"hud-skill-bow_repeater_speed_title",
"hud-skill-bow_repeater_speed",
modifiers.repeater.max_speed,
),
// Shotgun upgrades
BowSkill::UnlockShotgun => SkillStrings::plain(
"hud.skill.bow_shotgun_unlock_title",
"hud.skill.bow_shotgun_unlock",
"hud-skill-bow_shotgun_unlock_title",
"hud-skill-bow_shotgun_unlock",
),
BowSkill::SDamage => SkillStrings::with_mult(
"hud.skill.bow_shotgun_damage_title",
"hud.skill.bow_shotgun_damage",
"hud-skill-bow_shotgun_damage_title",
"hud-skill-bow_shotgun_damage",
modifiers.shotgun.power,
),
BowSkill::SCost => SkillStrings::with_mult(
"hud.skill.bow_shotgun_cost_title",
"hud.skill.bow_shotgun_cost",
"hud-skill-bow_shotgun_cost_title",
"hud-skill-bow_shotgun_cost",
modifiers.shotgun.energy_cost,
),
BowSkill::SArrows => SkillStrings::with_const(
"hud.skill.bow_shotgun_arrow_count_title",
"hud.skill.bow_shotgun_arrow_count",
"hud-skill-bow_shotgun_arrow_count_title",
"hud-skill-bow_shotgun_arrow_count",
modifiers.shotgun.num_projectiles,
),
BowSkill::SSpread => SkillStrings::with_mult(
"hud.skill.bow_shotgun_spread_title",
"hud.skill.bow_shotgun_spread",
"hud-skill-bow_shotgun_spread_title",
"hud-skill-bow_shotgun_spread",
modifiers.shotgun.spread,
),
}
@ -3154,64 +3154,64 @@ fn staff_skill_strings(skill: StaffSkill) -> SkillStrings<'static> {
match skill {
// Basic ranged upgrades
StaffSkill::BDamage => SkillStrings::with_mult(
"hud.skill.st_damage_title",
"hud.skill.st_damage",
"hud-skill-st_damage_title",
"hud-skill-st_damage",
modifiers.fireball.power,
),
StaffSkill::BRegen => SkillStrings::with_mult(
"hud.skill.st_energy_regen_title",
"hud.skill.st_energy_regen",
"hud-skill-st_energy_regen_title",
"hud-skill-st_energy_regen",
modifiers.fireball.regen,
),
StaffSkill::BRadius => SkillStrings::with_mult(
"hud.skill.st_explosion_radius_title",
"hud.skill.st_explosion_radius",
"hud-skill-st_explosion_radius_title",
"hud-skill-st_explosion_radius",
modifiers.fireball.range,
),
// Flamethrower upgrades
StaffSkill::FDamage => SkillStrings::with_mult(
"hud.skill.st_flamethrower_damage_title",
"hud.skill.st_flamethrower_damage",
"hud-skill-st_flamethrower_damage_title",
"hud-skill-st_flamethrower_damage",
modifiers.flamethrower.damage,
),
StaffSkill::FRange => SkillStrings::with_mult(
"hud.skill.st_flamethrower_range_title",
"hud.skill.st_flamethrower_range",
"hud-skill-st_flamethrower_range_title",
"hud-skill-st_flamethrower_range",
modifiers.flamethrower.range,
),
StaffSkill::FDrain => SkillStrings::with_mult(
"hud.skill.st_energy_drain_title",
"hud.skill.st_energy_drain",
"hud-skill-st_energy_drain_title",
"hud-skill-st_energy_drain",
modifiers.flamethrower.energy_drain,
),
StaffSkill::FVelocity => SkillStrings::with_mult(
"hud.skill.st_flame_velocity_title",
"hud.skill.st_flame_velocity",
"hud-skill-st_flame_velocity_title",
"hud-skill-st_flame_velocity",
modifiers.flamethrower.velocity,
),
// Shockwave upgrades
StaffSkill::UnlockShockwave => SkillStrings::plain(
"hud.skill.st_shockwave_unlock_title",
"hud.skill.st_shockwave_unlock",
"hud-skill-st_shockwave_unlock_title",
"hud-skill-st_shockwave_unlock",
),
StaffSkill::SDamage => SkillStrings::with_mult(
"hud.skill.st_shockwave_damage_title",
"hud.skill.st_shockwave_damage",
"hud-skill-st_shockwave_damage_title",
"hud-skill-st_shockwave_damage",
modifiers.shockwave.damage,
),
StaffSkill::SKnockback => SkillStrings::with_mult(
"hud.skill.st_shockwave_knockback_title",
"hud.skill.st_shockwave_knockback",
"hud-skill-st_shockwave_knockback_title",
"hud-skill-st_shockwave_knockback",
modifiers.shockwave.knockback,
),
StaffSkill::SRange => SkillStrings::with_mult(
"hud.skill.st_shockwave_range_title",
"hud.skill.st_shockwave_range",
"hud-skill-st_shockwave_range_title",
"hud-skill-st_shockwave_range",
modifiers.shockwave.duration,
),
StaffSkill::SCost => SkillStrings::with_mult(
"hud.skill.st_shockwave_cost_title",
"hud.skill.st_shockwave_cost",
"hud-skill-st_shockwave_cost_title",
"hud-skill-st_shockwave_cost",
modifiers.shockwave.energy_cost,
),
}
@ -3222,69 +3222,69 @@ fn sceptre_skill_strings(skill: SceptreSkill) -> SkillStrings<'static> {
match skill {
// Lifesteal beam upgrades
SceptreSkill::LDamage => SkillStrings::with_mult(
"hud.skill.sc_lifesteal_damage_title",
"hud.skill.sc_lifesteal_damage",
"hud-skill-sc_lifesteal_damage_title",
"hud-skill-sc_lifesteal_damage",
modifiers.beam.damage,
),
SceptreSkill::LRange => SkillStrings::with_mult(
"hud.skill.sc_lifesteal_range_title",
"hud.skill.sc_lifesteal_range",
"hud-skill-sc_lifesteal_range_title",
"hud-skill-sc_lifesteal_range",
modifiers.beam.range,
),
SceptreSkill::LLifesteal => SkillStrings::with_mult(
"hud.skill.sc_lifesteal_lifesteal_title",
"hud.skill.sc_lifesteal_lifesteal",
"hud-skill-sc_lifesteal_lifesteal_title",
"hud-skill-sc_lifesteal_lifesteal",
modifiers.beam.lifesteal,
),
SceptreSkill::LRegen => SkillStrings::with_mult(
"hud.skill.sc_lifesteal_regen_title",
"hud.skill.sc_lifesteal_regen",
"hud-skill-sc_lifesteal_regen_title",
"hud-skill-sc_lifesteal_regen",
modifiers.beam.energy_regen,
),
// Healing aura upgrades
SceptreSkill::HHeal => SkillStrings::with_mult(
"hud.skill.sc_heal_heal_title",
"hud.skill.sc_heal_heal",
"hud-skill-sc_heal_heal_title",
"hud-skill-sc_heal_heal",
modifiers.healing_aura.strength,
),
SceptreSkill::HRange => SkillStrings::with_mult(
"hud.skill.sc_heal_range_title",
"hud.skill.sc_heal_range",
"hud-skill-sc_heal_range_title",
"hud-skill-sc_heal_range",
modifiers.healing_aura.range,
),
SceptreSkill::HDuration => SkillStrings::with_mult(
"hud.skill.sc_heal_duration_title",
"hud.skill.sc_heal_duration",
"hud-skill-sc_heal_duration_title",
"hud-skill-sc_heal_duration",
modifiers.healing_aura.duration,
),
SceptreSkill::HCost => SkillStrings::with_mult(
"hud.skill.sc_heal_cost_title",
"hud.skill.sc_heal_cost",
"hud-skill-sc_heal_cost_title",
"hud-skill-sc_heal_cost",
modifiers.healing_aura.energy_cost,
),
// Warding aura upgrades
SceptreSkill::UnlockAura => SkillStrings::plain(
"hud.skill.sc_wardaura_unlock_title",
"hud.skill.sc_wardaura_unlock",
"hud-skill-sc_wardaura_unlock_title",
"hud-skill-sc_wardaura_unlock",
),
SceptreSkill::AStrength => SkillStrings::with_mult(
"hud.skill.sc_wardaura_strength_title",
"hud.skill.sc_wardaura_strength",
"hud-skill-sc_wardaura_strength_title",
"hud-skill-sc_wardaura_strength",
modifiers.warding_aura.strength,
),
SceptreSkill::ADuration => SkillStrings::with_mult(
"hud.skill.sc_wardaura_duration_title",
"hud.skill.sc_wardaura_duration",
"hud-skill-sc_wardaura_duration_title",
"hud-kill-sc_wardaura_duration",
modifiers.warding_aura.duration,
),
SceptreSkill::ARange => SkillStrings::with_mult(
"hud.skill.sc_wardaura_range_title",
"hud.skill.sc_wardaura_range",
"hud-skill-sc_wardaura_range_title",
"hud-skill-sc_wardaura_range",
modifiers.warding_aura.range,
),
SceptreSkill::ACost => SkillStrings::with_mult(
"hud.skill.sc_wardaura_cost_title",
"hud.skill.sc_wardaura_cost",
"hud-skill-sc_wardaura_cost_title",
"hud-skill-sc_wardaura_cost",
modifiers.warding_aura.energy_cost,
),
}
@ -3294,18 +3294,18 @@ fn roll_skill_strings(skill: RollSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.general_tree.roll;
match skill {
RollSkill::Cost => SkillStrings::with_mult(
"hud.skill.roll_energy_title",
"hud.skill.roll_energy",
"hud-skill-roll_energy_title",
"hud-skill-roll_energy",
modifiers.energy_cost,
),
RollSkill::Strength => SkillStrings::with_mult(
"hud.skill.roll_speed_title",
"hud.skill.roll_speed",
"hud-skill-roll_speed_title",
"hud-skill-roll_speed",
modifiers.strength,
),
RollSkill::Duration => SkillStrings::with_mult(
"hud.skill.roll_dur_title",
"hud.skill.roll_dur",
"hud-skill-roll_dur_title",
"hud-skill-roll_dur",
modifiers.duration,
),
}
@ -3315,13 +3315,13 @@ fn climb_skill_strings(skill: ClimbSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.general_tree.climb;
match skill {
ClimbSkill::Cost => SkillStrings::with_mult(
"hud.skill.climbing_cost_title",
"hud.skill.climbing_cost",
"hud-skill-climbing_cost_title",
"hud-skill-climbing_cost",
modifiers.energy_cost,
),
ClimbSkill::Speed => SkillStrings::with_mult(
"hud.skill.climbing_speed_title",
"hud.skill.climbing_speed",
"hud-skill-climbing_speed_title",
"hud-skill-climbing_speed",
modifiers.speed,
),
}
@ -3331,8 +3331,8 @@ fn swim_skill_strings(skill: SwimSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.general_tree.swim;
match skill {
SwimSkill::Speed => SkillStrings::with_mult(
"hud.skill.swim_speed_title",
"hud.skill.swim_speed",
"hud-skill-swim_speed_title",
"hud-skill-swim_speed",
modifiers.speed,
),
}
@ -3342,18 +3342,18 @@ fn mining_skill_strings(skill: MiningSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.mining_tree;
match skill {
MiningSkill::Speed => SkillStrings::with_mult(
"hud.skill.pick_strike_speed_title",
"hud.skill.pick_strike_speed",
"hud-skill-pick_strike_speed_title",
"hud-skill-pick_strike_speed",
modifiers.speed,
),
MiningSkill::OreGain => SkillStrings::with_const(
"hud.skill.pick_strike_oregain_title",
"hud.skill.pick_strike_oregain",
"hud-skill-pick_strike_oregain_title",
"hud-skill-pick_strike_oregain",
(modifiers.ore_gain * 100.0).round() as u32,
),
MiningSkill::GemGain => SkillStrings::with_const(
"hud.skill.pick_strike_gemgain_title",
"hud.skill.pick_strike_gemgain",
"hud-skill-pick_strike_gemgain_title",
"hud-skill-pick_strike_gemgain",
(modifiers.gem_gain * 100.0).round() as u32,
),
}
@ -3419,12 +3419,12 @@ impl<'a> SkillStrings<'a> {
) -> (Cow<'loc, str>, Cow<'loc, str>) {
match self {
Self::Plain { title, desc } => {
let title = i18n.get(title);
let title = i18n.get_msg(title);
let args = i18n::fluent_args! {
"SP" => sp(i18n, skill_set, skill),
};
let desc = i18n.get_msg_ctx(&desc.replace('.', "-"), &args);
let desc = i18n.get_msg_ctx(&desc, &args);
(title, desc)
},
@ -3433,7 +3433,7 @@ impl<'a> SkillStrings<'a> {
desc,
constant,
} => {
let title = i18n.get(title);
let title = i18n.get_msg(title);
let args = i18n::fluent_args! {
"boost" => constant,
"SP" => sp(i18n, skill_set, skill),
@ -3447,7 +3447,7 @@ impl<'a> SkillStrings<'a> {
desc,
constant,
} => {
let title = i18n.get(title);
let title = i18n.get_msg(title);
let args = i18n::fluent_args! {
"boost" => constant,
"SP" => sp(i18n, skill_set, skill),
@ -3463,7 +3463,7 @@ impl<'a> SkillStrings<'a> {
} => {
let percentage = hud::multiplier_to_percentage(*multiplier).abs();
let title = i18n.get(title);
let title = i18n.get_msg(title);
let args = i18n::fluent_args! {
"boost" => format!("{percentage:.0}"),

View File

@ -3763,7 +3763,7 @@ impl Hud {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.bottom_left_with_margins_on(ui_widgets.window, 350.0, 150.0)
.label(&i18n._msg("hud-tutorial_btn"))
.label(&i18n.get_msg("hud-tutorial_btn"))
.label_font_id(self.fonts.cyri.conrod_id)
.label_font_size(self.fonts.cyri.scale(18))
.label_color(TEXT_COLOR)
@ -3812,7 +3812,7 @@ impl Hud {
if self.show.intro {
self.show.want_grab = false;
let quest_headline = i18n.get_msg("hud-temp_quest_headline");
let quest_text = i18n.get("hud.temp_quest_text");
let quest_text = i18n.get_msg("hud-temp_quest_text");
Image::new(self.imgs.quest_bg)
.w_h(404.0, 858.0)
.middle_of(ui_widgets.window)
@ -3851,7 +3851,7 @@ impl Hud {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.mid_bottom_with_margin_on(self.ids.q_text_bg, -80.0)
.label(&i18n.get("common.close"))
.label(&i18n.get_msg("common-close"))
.label_font_id(self.fonts.cyri.conrod_id)
.label_font_size(self.fonts.cyri.scale(22))
.label_color(TEXT_COLOR)
@ -3875,14 +3875,14 @@ impl Hud {
)
.color(Some(QUALITY_LEGENDARY))
.set(self.ids.tut_arrow, ui_widgets);
Text::new(&i18n.get("hud.tutorial_elements"))
Text::new(&i18n.get_msg("hud-tutorial_elements"))
.mid_top_with_margin_on(self.ids.tut_arrow, -50.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(40))
.color(BLACK)
.floating(true)
.set(self.ids.tut_arrow_txt_bg, ui_widgets);
Text::new(&i18n.get("hud.tutorial_elements"))
Text::new(&i18n.get_msg("hud-tutorial_elements"))
.bottom_right_with_margins_on(self.ids.tut_arrow_txt_bg, 1.0, 1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(40))

View File

@ -394,7 +394,7 @@ impl<'a> Widget for Overhead<'a> {
}
let mut txt = format!("{}/{}", health_cur_txt, health_max_txt);
if health.is_dead {
txt = self.i18n.get("hud.group.dead").to_string()
txt = self.i18n.get_msg("hud-group-dead").to_string()
};
Text::new(&txt)
.mid_top_with_margin_on(state.ids.health_bar_bg, 2.0)

View File

@ -127,7 +127,7 @@ impl<'a> Widget for Popup<'a> {
if s.infos.is_empty() {
s.last_info_update = Instant::now();
}
let text = self.i18n.get("hud.waypoint_saved");
let text = self.i18n.get_msg("hud-waypoint_saved");
s.infos.push_back(text.to_string());
});
},

View File

@ -44,15 +44,15 @@ pub fn price_desc(
let deal_goodness = deal_goodness.log(2.0);
let buy_string = format!(
"{} : {:0.1} {}",
i18n.get("hud.trade.buy_price"),
i18n.get_msg("hud-trade-buy_price"),
buyprice / coinprice,
i18n.get("hud.trade.coin"),
i18n.get_msg("hud-trade-coin"),
);
let sell_string = format!(
"{} : {:0.1} {}",
i18n.get("hud.trade.sell_price"),
i18n.get_msg("hud-trade-sell_price"),
sellprice / coinprice,
i18n.get("hud.trade.coin"),
i18n.get_msg("hud-trade-coin"),
);
let deal_goodness = match deal_goodness {
x if x < -2.5 => 0.0,
@ -82,30 +82,30 @@ pub fn kind_text<'a>(kind: &ItemKind, i18n: &'a Localization) -> Cow<'a, str> {
if let Some(toolkind) = mc.toolkind() {
Cow::Owned(format!(
"{} {}",
i18n.get(&format!("common.weapons.{}", toolkind.identifier_name())),
i18n.get("common.kind.modular_component_partial")
i18n.get_msg(&format!("common-weapons-{}", toolkind.identifier_name())),
i18n.get_msg("common-kind-modular_component_partial")
))
} else {
i18n.get("common.kind.modular_component")
i18n.get_msg("common-kind-modular_component")
}
},
ItemKind::Glider => i18n.get("common.kind.glider"),
ItemKind::Consumable { .. } => i18n.get("common.kind.consumable"),
ItemKind::Throwable { .. } => i18n.get("common.kind.throwable"),
ItemKind::Utility { .. } => i18n.get("common.kind.utility"),
ItemKind::Ingredient { .. } => i18n.get("common.kind.ingredient"),
ItemKind::Lantern { .. } => i18n.get("common.kind.lantern"),
ItemKind::Glider => i18n.get_msg("common-kind-glider"),
ItemKind::Consumable { .. } => i18n.get_msg("common-kind-consumable"),
ItemKind::Throwable { .. } => i18n.get_msg("common-kind-throwable"),
ItemKind::Utility { .. } => i18n.get_msg("common-kind-utility"),
ItemKind::Ingredient { .. } => i18n.get_msg("common-kind-ingredient"),
ItemKind::Lantern { .. } => i18n.get_msg("common-kind-lantern"),
ItemKind::TagExamples { .. } => Cow::Borrowed(""),
}
}
pub fn material_kind_text<'a>(kind: &MaterialKind, i18n: &'a Localization) -> Cow<'a, str> {
match kind {
MaterialKind::Metal { .. } => i18n.get("common.material.metal"),
MaterialKind::Wood { .. } => i18n.get("common.material.wood"),
MaterialKind::Stone { .. } => i18n.get("common.material.stone"),
MaterialKind::Cloth { .. } => i18n.get("common.material.cloth"),
MaterialKind::Hide { .. } => i18n.get("common.material.hide"),
MaterialKind::Metal { .. } => i18n.get_msg("common-material-metal"),
MaterialKind::Wood { .. } => i18n.get_msg("common-material-wood"),
MaterialKind::Stone { .. } => i18n.get_msg("common-material-stone"),
MaterialKind::Cloth { .. } => i18n.get_msg("common-material-cloth"),
MaterialKind::Hide { .. } => i18n.get_msg("common-material-hide"),
}
}
@ -161,7 +161,7 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> Vec<String> {
"strength" => format_float(strength),
})
},
BuffKind::Invulnerability => i18n.get("buff.stat.invulnerability"),
BuffKind::Invulnerability => i18n.get_msg("buff-stat-invulnerability"),
BuffKind::Bleeding
| BuffKind::Burning
| BuffKind::CampfireHeal
@ -207,7 +207,7 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> Vec<String> {
| BuffKind::Hastened => Cow::Borrowed(""),
}
} else if let BuffKind::Saturation | BuffKind::Regeneration = buff.kind {
i18n.get("buff.text.every_second")
i18n.get_msg("buff-text-every_second")
} else {
Cow::Borrowed("")
};
@ -223,18 +223,18 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> Vec<String> {
// Armor
fn armor_kind<'a>(armor: &Armor, i18n: &'a Localization) -> Cow<'a, str> {
let kind = match armor.kind {
ArmorKind::Shoulder => i18n.get("hud.bag.shoulders"),
ArmorKind::Chest => i18n.get("hud.bag.chest"),
ArmorKind::Belt => i18n.get("hud.bag.belt"),
ArmorKind::Hand => i18n.get("hud.bag.hands"),
ArmorKind::Pants => i18n.get("hud.bag.legs"),
ArmorKind::Foot => i18n.get("hud.bag.feet"),
ArmorKind::Back => i18n.get("hud.bag.back"),
ArmorKind::Ring => i18n.get("hud.bag.ring"),
ArmorKind::Neck => i18n.get("hud.bag.neck"),
ArmorKind::Head => i18n.get("hud.bag.head"),
ArmorKind::Tabard => i18n.get("hud.bag.tabard"),
ArmorKind::Bag => i18n.get("hud.bag.bag"),
ArmorKind::Shoulder => i18n.get_msg("hud-bag-shoulders"),
ArmorKind::Chest => i18n.get_msg("hud-bag-chest"),
ArmorKind::Belt => i18n.get_msg("hud-bag-belt"),
ArmorKind::Hand => i18n.get_msg("hud-bag-hands"),
ArmorKind::Pants => i18n.get_msg("hud-bag-legs"),
ArmorKind::Foot => i18n.get_msg("hud-bag-feet"),
ArmorKind::Back => i18n.get_msg("hud-bag-back"),
ArmorKind::Ring => i18n.get_msg("hud-bag-ring"),
ArmorKind::Neck => i18n.get_msg("hud-bag-neck"),
ArmorKind::Head => i18n.get_msg("hud-bag-head"),
ArmorKind::Tabard => i18n.get_msg("hud-bag-tabard"),
ArmorKind::Bag => i18n.get_msg("hud-bag-bag"),
};
kind
}
@ -242,21 +242,21 @@ fn armor_kind<'a>(armor: &Armor, i18n: &'a Localization) -> Cow<'a, str> {
// Tool
fn tool_kind<'a>(tool: &Tool, i18n: &'a Localization) -> Cow<'a, str> {
let kind = match tool.kind {
ToolKind::Sword => i18n.get("common.weapons.sword"),
ToolKind::Axe => i18n.get("common.weapons.axe"),
ToolKind::Hammer => i18n.get("common.weapons.hammer"),
ToolKind::Bow => i18n.get("common.weapons.bow"),
ToolKind::Dagger => i18n.get("common.weapons.dagger"),
ToolKind::Staff => i18n.get("common.weapons.staff"),
ToolKind::Sceptre => i18n.get("common.weapons.sceptre"),
ToolKind::Shield => i18n.get("common.weapons.shield"),
ToolKind::Spear => i18n.get("common.weapons.spear"),
ToolKind::Blowgun => i18n.get("common.weapons.blowgun"),
ToolKind::Natural => i18n.get("common.weapons.natural"),
ToolKind::Debug => i18n.get("common.tool.debug"),
ToolKind::Farming => i18n.get("common.tool.farming"),
ToolKind::Pick => i18n.get("common.tool.pick"),
ToolKind::Empty => i18n.get("common.empty"),
ToolKind::Sword => i18n.get_msg("common-weapons-sword"),
ToolKind::Axe => i18n.get_msg("common-weapons-axe"),
ToolKind::Hammer => i18n.get_msg("common-weapons-hammer"),
ToolKind::Bow => i18n.get_msg("common-weapons-bow"),
ToolKind::Dagger => i18n.get_msg("common-weapons-dagger"),
ToolKind::Staff => i18n.get_msg("common-weapons-staff"),
ToolKind::Sceptre => i18n.get_msg("common-weapons-sceptre"),
ToolKind::Shield => i18n.get_msg("common-weapons-shield"),
ToolKind::Spear => i18n.get_msg("common-weapons-spear"),
ToolKind::Blowgun => i18n.get_msg("common-weapons-blowgun"),
ToolKind::Natural => i18n.get_msg("common-weapons-natural"),
ToolKind::Debug => i18n.get_msg("common-tool-debug"),
ToolKind::Farming => i18n.get_msg("common-tool-farming"),
ToolKind::Pick => i18n.get_msg("common-tool-pick"),
ToolKind::Empty => i18n.get_msg("common-empty"),
};
kind
}
@ -264,8 +264,8 @@ fn tool_kind<'a>(tool: &Tool, i18n: &'a Localization) -> Cow<'a, str> {
/// Output the number of hands needed to hold a tool
pub fn tool_hands<'a>(tool: &Tool, i18n: &'a Localization) -> Cow<'a, str> {
let hands = match tool.hands {
Hands::One => i18n.get("common.hands.one"),
Hands::Two => i18n.get("common.hands.two"),
Hands::One => i18n.get_msg("common-hands-one"),
Hands::Two => i18n.get_msg("common-hands-two"),
};
hands
}

View File

@ -444,7 +444,7 @@ impl Controls {
// instead of directly showing error message here
*info_content = Some(InfoContent::CharacterError(format!(
"{}: {}",
i18n.get("common.error"),
i18n.get_msg("common-error"),
error
)))
} else if let Some(InfoContent::CharacterError(_)) = info_content {
@ -559,7 +559,7 @@ impl Controls {
.into(),
Text::new(
// TODO: Add actual location here
i18n.get("char_selection.uncanny_valley"),
i18n.get_msg("char_selection-uncanny_valley"),
)
.into(),
]),
@ -605,7 +605,7 @@ impl Controls {
let button = Button::new(
new_character_button,
Container::new(Text::new(
i18n.get("char_selection.create_new_character"),
i18n.get_msg("char_selection-create_new_character"),
))
.width(Length::Fill)
.height(Length::Fill)
@ -684,7 +684,7 @@ impl Controls {
let mut bottom_content = vec![
Container::new(neat_button(
logout_button,
i18n.get("char_selection.logout").into_owned(),
i18n.get_msg("char_selection-logout").into_owned(),
FILL_FRAC_ONE,
button_style,
Some(Message::Logout),
@ -698,7 +698,7 @@ impl Controls {
bottom_content.push(
Container::new(neat_button(
spectate_button,
i18n.get("char_selection.spectate").into_owned(),
i18n.get_msg("char_selection-spectate").into_owned(),
FILL_FRAC_TWO,
button_style,
Some(Message::Spectate),
@ -713,7 +713,7 @@ impl Controls {
bottom_content.push(
Container::new(neat_button(
enter_world_button,
i18n.get("char_selection.enter_world").into_owned(),
i18n.get_msg("char_selection-enter_world").into_owned(),
FILL_FRAC_TWO,
button_style,
selected.map(|_| Message::EnterWorld),
@ -737,20 +737,20 @@ impl Controls {
if let Some(info_content) = info_content {
let over_content: Element<_> = match &info_content {
InfoContent::Deletion(_) => Column::with_children(vec![
Text::new(i18n.get("char_selection.delete_permanently"))
Text::new(i18n.get_msg("char_selection-delete_permanently"))
.size(fonts.cyri.scale(24))
.into(),
Row::with_children(vec![
neat_button(
no_button,
i18n.get("common.no").into_owned(),
i18n.get_msg("common-no").into_owned(),
FILL_FRAC_ONE,
button_style,
Some(Message::CancelDeletion),
),
neat_button(
yes_button,
i18n.get("common.yes").into_owned(),
i18n.get_msg("common-yes").into_owned(),
FILL_FRAC_ONE,
button_style,
Some(Message::ConfirmDeletion),
@ -764,22 +764,22 @@ impl Controls {
.spacing(10)
.into(),
InfoContent::LoadingCharacters => {
Text::new(i18n.get("char_selection.loading_characters"))
Text::new(i18n.get_msg("char_selection-loading_characters"))
.size(fonts.cyri.scale(24))
.into()
},
InfoContent::CreatingCharacter => {
Text::new(i18n.get("char_selection.creating_character"))
Text::new(i18n.get_msg("char_selection-creating_character"))
.size(fonts.cyri.scale(24))
.into()
},
InfoContent::EditingCharacter => {
Text::new(i18n.get("char_selection.editing_character"))
Text::new(i18n.get_msg("char_selection-editing_character"))
.size(fonts.cyri.scale(24))
.into()
},
InfoContent::DeletingCharacter => {
Text::new(i18n.get("char_selection.deleting_character"))
Text::new(i18n.get_msg("char_selection-deleting_character"))
.size(fonts.cyri.scale(24))
.into()
},
@ -787,7 +787,7 @@ impl Controls {
Text::new(error).size(fonts.cyri.scale(24)).into(),
Row::with_children(vec![neat_button(
no_button,
i18n.get("common.close").into_owned(),
i18n.get_msg("common-close").into_owned(),
FILL_FRAC_ONE,
button_style,
Some(Message::ClearCharacterListError),
@ -871,7 +871,7 @@ impl Controls {
icon_button(button, selected, msg, img).with_tooltip(
tooltip_manager,
move || {
let tooltip_text = i18n.get(tooltip_i18n_key);
let tooltip_text = i18n.get_msg(tooltip_i18n_key);
tooltip::text(&tooltip_text, tooltip_style)
},
)
@ -1137,7 +1137,7 @@ impl Controls {
let slider_options = Column::with_children(vec![
char_slider(
i18n.get("char_selection.hair_style").into_owned(),
i18n.get_msg("char_selection-hair_style").into_owned(),
&mut sliders.hair_style,
body.species.num_hair_styles(body.body_type) - 1,
body.hair_style,
@ -1145,7 +1145,7 @@ impl Controls {
(fonts, imgs),
),
char_slider(
i18n.get("char_selection.hair_color").into_owned(),
i18n.get_msg("char_selection-hair_color").into_owned(),
&mut sliders.hair_color,
body.species.num_hair_colors() - 1,
body.hair_color,
@ -1153,7 +1153,7 @@ impl Controls {
(fonts, imgs),
),
char_slider(
i18n.get("char_selection.skin").into_owned(),
i18n.get_msg("char_selection-skin").into_owned(),
&mut sliders.skin,
body.species.num_skin_colors() - 1,
body.skin,
@ -1161,7 +1161,7 @@ impl Controls {
(fonts, imgs),
),
char_slider(
i18n.get("char_selection.eyeshape").into_owned(),
i18n.get_msg("char_selection-eyeshape").into_owned(),
&mut sliders.eyes,
body.species.num_eyes(body.body_type) - 1,
body.eyes,
@ -1169,7 +1169,7 @@ impl Controls {
(fonts, imgs),
),
char_slider(
i18n.get("char_selection.eye_color").into_owned(),
i18n.get_msg("char_selection-eye_color").into_owned(),
&mut sliders.eye_color,
body.species.num_eye_colors() - 1,
body.eye_color,
@ -1178,7 +1178,7 @@ impl Controls {
),
char_slider_greyable(
body.species.num_accessories(body.body_type) > 1,
i18n.get("char_selection.accessories").into_owned(),
i18n.get_msg("char_selection-accessories").into_owned(),
&mut sliders.accessory,
body.species.num_accessories(body.body_type) - 1,
body.accessory,
@ -1187,7 +1187,7 @@ impl Controls {
),
char_slider_greyable(
body.species.num_beards(body.body_type) > 1,
i18n.get("char_selection.beard").into_owned(),
i18n.get_msg("char_selection-beard").into_owned(),
&mut sliders.beard,
body.species.num_beards(body.body_type) - 1,
body.beard,
@ -1210,7 +1210,7 @@ impl Controls {
)
.on_press(Message::RandomizeCharacter)
.with_tooltip(tooltip_manager, move || {
let tooltip_text = i18n.get("common.rand_appearance");
let tooltip_text = i18n.get_msg("common-rand_appearance");
tooltip::text(&tooltip_text, tooltip_style)
});
@ -1270,7 +1270,7 @@ impl Controls {
let back = neat_button(
back_button,
i18n.get("common.back").into_owned(),
i18n.get_msg("common-back").into_owned(),
FILL_FRAC_ONE,
button_style,
Some(Message::Back),
@ -1288,7 +1288,7 @@ impl Controls {
)
.on_press(Message::RandomizeName)
.with_tooltip(tooltip_manager, move || {
let tooltip_text = i18n.get("common.rand_name");
let tooltip_text = i18n.get_msg("common-rand_name");
tooltip::text(&tooltip_text, tooltip_style)
});
@ -1304,7 +1304,7 @@ impl Controls {
.fix_aspect_ratio(),
TextInput::new(
name_input,
&i18n.get("character_window.character_name"),
&i18n.get_msg("character_window-character_name"),
name,
Message::Name,
)
@ -1328,10 +1328,10 @@ impl Controls {
let create = neat_button(
create_button,
i18n.get(if character_id.is_some() {
"common.confirm"
i18n.get_msg(if character_id.is_some() {
"common-confirm"
} else {
"common.create"
"common-create"
}),
FILL_FRAC_ONE,
button_style,
@ -1341,7 +1341,7 @@ impl Controls {
let create: Element<Message> = if name.is_empty() {
create
.with_tooltip(tooltip_manager, move || {
let tooltip_text = i18n.get("char_selection.create_info_name");
let tooltip_text = i18n.get_msg("char_selection-create_info_name");
tooltip::text(&tooltip_text, tooltip_style)
})
.into()
@ -1379,10 +1379,10 @@ impl Controls {
if let Some(mismatched_version) = &self.server_mismatched_version {
let warning = Text::<IcedRenderer>::new(format!(
"{}\n{}: {} {}: {}",
i18n.get("char_selection.version_mismatch"),
i18n.get("main.login.server_version"),
i18n.get_msg("char_selection-version_mismatch"),
i18n.get_msg("main-login-server_version"),
mismatched_version,
i18n.get("main.login.client_version"),
i18n.get_msg("main-login-client_version"),
*common::util::GIT_HASH
))
.size(self.fonts.cyri.scale(18))

View File

@ -102,7 +102,7 @@ impl Screen {
let tip = if show_tip {
let key = |code| match controls.keybindings.get(&code) {
Some(Some(key_mouse)) => key_mouse.display_string(key_layout),
Some(None) => i18n.get("main.unbound_key_tip").into_owned(),
Some(None) => i18n.get_msg("main-unbound_key_tip").into_owned(),
None => ControlSettings::default_binding(code).display_string(key_layout),
};
let keys = i18n::fluent_args! {
@ -118,7 +118,7 @@ impl Screen {
"gameinput-screenshot" => key(GameInput::Screenshot),
};
let tip = &i18n.get_variation_ctx("loading-tips", self.tip_number, &keys);
let tip = format!("{} {}", i18n.get("main.tip"), tip);
let tip = format!("{} {}", i18n.get_msg("main-tip"), tip);
Container::new(Text::new(tip).size(fonts.cyri.scale(25)))
.width(Length::Fill)
@ -132,7 +132,7 @@ impl Screen {
let cancel = Container::new(neat_button(
&mut self.cancel_button,
i18n.get("common.cancel"),
i18n.get_msg("common-cancel"),
0.7,
button_style,
Some(Message::CancelConnect),
@ -190,14 +190,14 @@ impl Screen {
let cancel = neat_button(
&mut self.cancel_button,
i18n.get("common.cancel"),
i18n.get_msg("common-cancel"),
0.7,
button_style,
Some(Message::TrustPromptCancel),
);
let add = neat_button(
&mut self.add_button,
i18n.get("common.add"),
i18n.get_msg("common-add"),
0.7,
button_style,
Some(Message::TrustPromptAdd),

View File

@ -40,7 +40,7 @@ impl Screen {
write!(
&mut text,
" {} {}",
i18n.get("main.credits.created_by"),
i18n.get_msg("main-credits-created_by"),
author
)?;
}
@ -79,7 +79,7 @@ impl Screen {
) -> Element<'a, Message> {
Column::with_children(
core::iter::once(
iced::Text::new(i18n.get(header_i18n_key))
iced::Text::new(i18n.get_msg(header_i18n_key))
.font(fonts.cyri.id)
.size(fonts.cyri.scale(30))
.color(header_color)
@ -119,7 +119,7 @@ impl Screen {
Container::new(
Container::new(
Column::with_children(vec![
iced::Text::new(i18n.get("main.credits"))
iced::Text::new(i18n.get_msg("main-credits"))
.font(fonts.alkhemi.id)
.size(fonts.alkhemi.scale(35))
.width(Length::Fill)
@ -156,7 +156,7 @@ impl Screen {
Container::new(
Container::new(neat_button(
&mut self.back_button,
i18n.get("common.back"),
i18n.get_msg("common-back"),
0.7,
button_style,
Some(Message::Back),

View File

@ -31,14 +31,14 @@ impl Screen {
Container::new(
Container::new(
Column::with_children(vec![
iced::Text::new(i18n.get("common.disclaimer"))
iced::Text::new(i18n.get_msg("common-disclaimer"))
.font(fonts.alkhemi.id)
.size(fonts.alkhemi.scale(35))
.into(),
Space::new(Length::Fill, Length::Units(20)).into(),
Scrollable::new(&mut self.scroll)
.push(
iced::Text::new(i18n.get("main.notice"))
iced::Text::new(i18n.get_msg("main-notice"))
.font(fonts.cyri.id)
.size(fonts.cyri.scale(23)),
)
@ -47,7 +47,7 @@ impl Screen {
Container::new(
Container::new(neat_button(
&mut self.accept_button,
i18n.get("common.accept"),
i18n.get_msg("common-accept"),
0.7,
button_style,
Some(Message::AcceptDisclaimer),

View File

@ -67,35 +67,35 @@ impl Screen {
let buttons = Column::with_children(vec![
neat_button(
&mut self.servers_button,
i18n.get("common.servers"),
i18n.get_msg("common-servers"),
FILL_FRAC_ONE,
button_style,
Some(Message::ShowServers),
),
// neat_button(
// &mut self.settings_button,
// i18n.get("common.settings"),
// i18n.get_msg("common-settings"),
// FILL_FRAC_ONE,
// button_style,
// None,
// ),
neat_button(
&mut self.language_select_button,
i18n.get("common.languages"),
i18n.get_msg("common-languages"),
FILL_FRAC_ONE,
button_style,
Some(Message::OpenLanguageMenu),
),
neat_button(
&mut self.credits_button,
i18n.get("main.credits"),
i18n.get_msg("main-credits"),
FILL_FRAC_ONE,
button_style,
Some(Message::ShowCredits),
),
neat_button(
&mut self.quit_button,
i18n.get("common.quit"),
i18n.get_msg("common-quit"),
FILL_FRAC_ONE,
button_style,
Some(Message::Quit),
@ -110,7 +110,7 @@ impl Screen {
.height(Length::Fill)
.align_y(Align::End);
let intro_text = i18n.get("main.login_process");
let intro_text = i18n.get_msg("main-login_process");
let info_window = BackgroundContainer::new(
CompoundGraphic::from_graphics(vec![
@ -139,7 +139,7 @@ impl Screen {
Container::new(Text::new(error)).height(Length::Fill).into(),
Container::new(neat_button(
&mut self.error_okay_button,
i18n.get("common.okay"),
i18n.get_msg("common-okay"),
FILL_FRAC_ONE,
button_style,
Some(Message::CloseError),
@ -238,7 +238,7 @@ impl LanguageSelectBanner {
self.language_buttons = vec![Default::default(); language_metadatas.len()];
}
let title = Text::new(i18n.get("main.login.select_language"))
let title = Text::new(i18n.get_msg("main-login-select_language"))
.size(fonts.cyri.scale(35))
.horizontal_alignment(iced::HorizontalAlignment::Center);
@ -290,7 +290,7 @@ impl LanguageSelectBanner {
let okay_button = Container::new(neat_button(
&mut self.okay_button,
i18n.get("common.okay"),
i18n.get_msg("common-okay"),
FILL_FRAC_TWO,
button_style,
Some(Message::OpenLanguageMenu),
@ -363,7 +363,7 @@ impl LoginBanner {
.fix_aspect_ratio(),
TextInput::new(
&mut self.username,
&i18n.get("main.username"),
&i18n.get_msg("main-username"),
&login_info.username,
Message::Username,
)
@ -378,7 +378,7 @@ impl LoginBanner {
.fix_aspect_ratio(),
TextInput::new(
&mut self.password,
&i18n.get("main.password"),
&i18n.get_msg("main-password"),
&login_info.password,
Message::Password,
)
@ -394,7 +394,7 @@ impl LoginBanner {
.fix_aspect_ratio(),
TextInput::new(
&mut self.server,
&i18n.get("main.server"),
&i18n.get_msg("main-server"),
&login_info.server,
Message::Server,
)
@ -410,7 +410,7 @@ impl LoginBanner {
Column::with_children(vec![
neat_button(
&mut self.multiplayer_button,
i18n.get("common.multiplayer"),
i18n.get_msg("common-multiplayer"),
FILL_FRAC_TWO,
button_style,
Some(Message::Multiplayer),
@ -418,7 +418,7 @@ impl LoginBanner {
#[cfg(feature = "singleplayer")]
neat_button(
&mut self.singleplayer_button,
i18n.get("common.singleplayer"),
i18n.get_msg("common-singleplayer"),
FILL_FRAC_TWO,
button_style,
Some(Message::Singleplayer),

View File

@ -34,7 +34,7 @@ impl Screen {
i18n: &Localization,
button_style: style::button::Style,
) -> Element<Message> {
let title = Text::new(i18n.get("main.servers.select_server"))
let title = Text::new(i18n.get_msg("main-servers-select_server"))
.size(fonts.cyri.scale(35))
.width(Length::Fill)
.horizontal_alignment(iced::HorizontalAlignment::Center);
@ -42,7 +42,7 @@ impl Screen {
let back_button = Container::new(
Container::new(neat_button(
&mut self.back_button,
i18n.get("common.back"),
i18n.get_msg("common-back"),
FILL_FRAC_ONE,
button_style,
Some(Message::Back),
@ -55,7 +55,7 @@ impl Screen {
let delete_button = Container::new(
Container::new(neat_button(
&mut self.delete_button,
i18n.get("common.delete_server"),
i18n.get_msg("common-delete_server"),
FILL_FRAC_ONE,
button_style,
Some(Message::DeleteServer),

View File

@ -258,9 +258,9 @@ impl SessionState {
self.hud.clear_cursor();
let i18n = global_state.i18n.read();
let msg = match result {
TradeResult::Completed => i18n.get("hud.trade.result.completed"),
TradeResult::Declined => i18n.get("hud.trade.result.declined"),
TradeResult::NotEnoughSpace => i18n.get("hud.trade.result.nospace"),
TradeResult::Completed => i18n.get_msg("hud-trade-result-completed"),
TradeResult::Declined => i18n.get_msg("hud-trade-result-declined"),
TradeResult::NotEnoughSpace => i18n.get_msg("hud-trade-result-nospace"),
};
self.hud.new_message(ChatType::Meta.chat_msg(msg));
},
@ -327,7 +327,7 @@ impl SessionState {
let i18n = global_state.i18n.read();
let message = match time {
0 => String::from(i18n.get("hud.chat.goodbye")),
0 => String::from(i18n.get_msg("hud-chat-goodbye")),
_ => i18n
.get_msg_ctx("hud-chat-connection_lost", &i18n::fluent_args! {
"time" => time

View File

@ -588,7 +588,7 @@ impl<'a> Widget for ItemTooltip<'a> {
// Power
widget::Text::new(&format!(
"{} : {:.1}",
i18n.get("common.stats.power"),
i18n.get_msg("common-stats-power"),
stats.power * 10.0
))
.x_align_to(state.ids.item_frame, conrod_core::position::Align::Start)
@ -613,7 +613,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:+.0}%",
i18n.get("common.stats.speed"),
i18n.get_msg("common-stats-speed"),
(stats.speed - 1.0) * 100.0
),
1,
@ -625,7 +625,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:+.0}%",
i18n.get("common.stats.poise"),
i18n.get_msg("common-stats-poise"),
(stats.effect_power - 1.0) * 100.0
),
2,
@ -635,7 +635,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:.1}%",
i18n.get("common.stats.crit_chance"),
i18n.get_msg("common-stats-crit_chance"),
stats.crit_chance * 100.0
),
3,
@ -645,7 +645,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:+.0}%",
i18n.get("common.stats.range"),
i18n.get_msg("common-stats-range"),
(stats.range - 1.0) * 100.0
),
4,
@ -655,7 +655,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:+.0}%",
i18n.get("common.stats.energy_efficiency"),
i18n.get_msg("common-stats-energy_efficiency"),
(stats.energy_efficiency - 1.0) * 100.0
),
5,
@ -665,7 +665,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:+.0}%",
i18n.get("common.stats.buff_strength"),
i18n.get_msg("common-stats-buff_strength"),
(stats.buff_strength - 1.0) * 100.0
),
6,
@ -786,7 +786,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {}",
i18n.get("common.stats.armor"),
i18n.get_msg("common-stats-armor"),
util::protec2string(
armor_stats.protection.unwrap_or(Protection::Normal(0.0))
)
@ -801,7 +801,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {}",
i18n.get("common.stats.poise_res"),
i18n.get_msg("common-stats-poise_res"),
util::protec2string(
armor_stats
.poise_resilience
@ -818,7 +818,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:.1}",
i18n.get("common.stats.energy_max"),
i18n.get_msg("common-stats-energy_max"),
armor_stats.energy_max.unwrap_or(0.0)
),
index,
@ -831,7 +831,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:.1}%",
i18n.get("common.stats.energy_reward"),
i18n.get_msg("common-stats-energy_reward"),
armor_stats.energy_reward.map_or(0.0, |x| x * 100.0)
),
index,
@ -844,7 +844,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:.3}",
i18n.get("common.stats.crit_power"),
i18n.get_msg("common-stats-crit_power"),
armor_stats.crit_power.unwrap_or(0.0)
),
index,
@ -857,7 +857,7 @@ impl<'a> Widget for ItemTooltip<'a> {
stat_text(
format!(
"{} : {:.3}",
i18n.get("common.stats.stealth"),
i18n.get_msg("common-stats-stealth"),
armor_stats.stealth.unwrap_or(0.0)
),
index,
@ -868,7 +868,7 @@ impl<'a> Widget for ItemTooltip<'a> {
// Slots
if item.num_slots() > 0 {
stat_text(
format!("{} : {}", i18n.get("common.stats.slots"), item.num_slots()),
format!("{} : {}", i18n.get_msg("common-stats-slots"), item.num_slots()),
index,
);
}
@ -1002,11 +1002,11 @@ impl<'a> Widget for ItemTooltip<'a> {
let power_text = if is_primary {
format!(
"{} : {:.1}",
i18n.get("common.stats.power"),
i18n.get_msg("common-stats-power"),
stats.power * 10.0
)
} else {
format!("{} : x{:.2}", i18n.get("common.stats.power"), stats.power)
format!("{} : x{:.2}", i18n.get_msg("common-stats-power"), stats.power)
};
widget::Text::new(&power_text)
.x_align_to(state.ids.item_frame, conrod_core::position::Align::Start)
@ -1021,11 +1021,11 @@ impl<'a> Widget for ItemTooltip<'a> {
let speed_text = if is_primary {
format!(
"{} : {:+.0}%",
i18n.get("common.stats.speed"),
i18n.get_msg("common-stats-speed"),
(stats.speed - 1.0) * 100.0
)
} else {
format!("{} : x{:.2}", i18n.get("common.stats.speed"), stats.speed)
format!("{} : x{:.2}", i18n.get_msg("common-stats-speed"), stats.speed)
};
widget::Text::new(&speed_text)
.graphics_for(id)
@ -1041,13 +1041,13 @@ impl<'a> Widget for ItemTooltip<'a> {
let effect_power_text = if is_primary {
format!(
"{} : {:+.0}%",
i18n.get("common.stats.poise"),
i18n.get_msg("common-stats-poise"),
(stats.effect_power - 1.0) * 100.0
)
} else {
format!(
"{} : x{:.2}",
i18n.get("common.stats.poise"),
i18n.get_msg("common-stats-poise"),
stats.effect_power
)
};
@ -1063,13 +1063,13 @@ impl<'a> Widget for ItemTooltip<'a> {
let crit_chance_text = if is_primary {
format!(
"{} : {:.1}%",
i18n.get("common.stats.crit_chance"),
i18n.get_msg("common-stats-crit_chance"),
stats.crit_chance * 100.0
)
} else {
format!(
"{} : x{:.2}",
i18n.get("common.stats.crit_chance"),
i18n.get_msg("common-stats-crit_chance"),
stats.crit_chance
)
};
@ -1085,11 +1085,11 @@ impl<'a> Widget for ItemTooltip<'a> {
let range_text = if is_primary {
format!(
"{} : {:.0}%",
i18n.get("common.stats.range"),
i18n.get_msg("common-stats-range"),
(stats.range - 1.0) * 100.0
)
} else {
format!("{} : x{:.2}", i18n.get("common.stats.range"), stats.range)
format!("{} : x{:.2}", i18n.get_msg("common-stats-range"), stats.range)
};
widget::Text::new(&range_text)
.graphics_for(id)
@ -1103,13 +1103,13 @@ impl<'a> Widget for ItemTooltip<'a> {
let energy_eff_text = if is_primary {
format!(
"{} : {:.0}%",
i18n.get("common.stats.energy_efficiency"),
i18n.get_msg("common-stats-energy_efficiency"),
(stats.energy_efficiency - 1.0) * 100.0
)
} else {
format!(
"{} : x{:.2}",
i18n.get("common.stats.energy_efficiency"),
i18n.get_msg("common-stats-energy_efficiency"),
stats.energy_efficiency
)
};
@ -1125,13 +1125,13 @@ impl<'a> Widget for ItemTooltip<'a> {
let buff_str_text = if is_primary {
format!(
"{} : {:.0}%",
i18n.get("common.stats.buff_strength"),
i18n.get_msg("common-stats-buff_strength"),
(stats.buff_strength - 1.0) * 100.0
)
} else {
format!(
"{} : x{:.2}",
i18n.get("common.stats.buff_strength"),
i18n.get_msg("common-stats-buff_strength"),
stats.buff_strength
)
};
@ -1203,8 +1203,8 @@ impl<'a> Widget for ItemTooltip<'a> {
//Tooltips for trade mini-tutorial
widget::Text::new(&format!(
"{}\n{}",
i18n.get("hud.trade.tooltip_hint_1"),
i18n.get("hud.trade.tooltip_hint_2"),
i18n.get_msg("hud-trade-tooltip_hint_1"),
i18n.get_msg("hud-trade-tooltip_hint_2"),
))
.x_align_to(state.ids.item_frame, conrod_core::position::Align::Start)
.graphics_for(id)