Allow translation for hanging sign & lights

This commit is contained in:
Thomas S 2024-03-31 09:18:02 +00:00 committed by Marcel
parent 80fe5ca64b
commit eaecbef5a8
2 changed files with 11 additions and 2 deletions

View File

@ -116,3 +116,8 @@ common-sprite-chair = Chair
common-sprite-mud = Mud common-sprite-mud = Mud
common-sprite-grave = Grave common-sprite-grave = Grave
common-sprite-crate = Crate common-sprite-crate = Crate
common-sprite-signboard = Signboard
common-sprite-street_lamp = Street Lamp
common-sprite-lantern = Lantern
common-sprite-seashell_lantern = Seashell Lantern
common-sprite-firebowl_ground = Firebowl

View File

@ -5269,8 +5269,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) -> Option<Cow<str>> { pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) -> Option<Cow<str>> {
let i18n_key = match sprite { let i18n_key = match sprite {
SpriteKind::Empty => return None, SpriteKind::Empty | SpriteKind::GlassBarrier => return None,
SpriteKind::GlassBarrier => return None,
SpriteKind::Anvil => "hud-crafting-anvil", SpriteKind::Anvil => "hud-crafting-anvil",
SpriteKind::Cauldron => "hud-crafting-cauldron", SpriteKind::Cauldron => "hud-crafting-cauldron",
SpriteKind::CookingPot => "hud-crafting-cooking_pot", SpriteKind::CookingPot => "hud-crafting-cooking_pot",
@ -5295,6 +5294,11 @@ pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) ->
SpriteKind::Grave => "common-sprite-grave", SpriteKind::Grave => "common-sprite-grave",
SpriteKind::ChairSingle | SpriteKind::ChairDouble => "common-sprite-chair", SpriteKind::ChairSingle | SpriteKind::ChairDouble => "common-sprite-chair",
SpriteKind::Crate => "common-sprite-crate", SpriteKind::Crate => "common-sprite-crate",
SpriteKind::HangingSign => "common-sprite-signboard",
SpriteKind::StreetLamp => "common-sprite-street_lamp",
SpriteKind::Lantern => "common-sprite-lantern",
SpriteKind::SeashellLantern => "common-sprite-seashell_lantern",
SpriteKind::FireBowlGround => "common-sprite-firebowl_ground",
sprite => return Some(Cow::Owned(format!("{:?}", sprite))), sprite => return Some(Cow::Owned(format!("{:?}", sprite))),
}; };
Some(localized_strings.get_msg(i18n_key)) Some(localized_strings.get_msg(i18n_key))