From e760d3c1a0dbc943f21901a748f4937535cd1b5b Mon Sep 17 00:00:00 2001 From: coffee-compiler <22056268-coffee-compiler@users.noreply.gitlab.com> Date: Sat, 24 Aug 2024 08:23:04 +0000 Subject: [PATCH] Localize map shape for world generation --- assets/voxygen/i18n/en/main.ftl | 2 ++ voxygen/src/menu/main/ui/world_selector.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/voxygen/i18n/en/main.ftl b/assets/voxygen/i18n/en/main.ftl index 8059fa1c1d..f400fccb1b 100644 --- a/assets/voxygen/i18n/en/main.ftl +++ b/assets/voxygen/i18n/en/main.ftl @@ -42,6 +42,8 @@ main-singleplayer-world_name = World name main-singleplayer-map_scale = Vertical scaling main-singleplayer-map_erosion_quality = Erosion quality main-singleplayer-map_shape = Shape +main-singleplayer-map_shape-circle = Circle +main-singleplayer-map_shape-square = Square main-singleplayer-play = Play main-singleplayer-generate_and_play = Generate & Play menu-singleplayer-confirm_delete = Are you sure you want to delete "{ $world_name }"? diff --git a/voxygen/src/menu/main/ui/world_selector.rs b/voxygen/src/menu/main/ui/world_selector.rs index f84dc19d90..75e6b48fde 100644 --- a/voxygen/src/menu/main/ui/world_selector.rs +++ b/voxygen/src/menu/main/ui/world_selector.rs @@ -436,7 +436,7 @@ impl Screen { Row::with_children(vec![ Space::new(Length::FillPortion(5), Length::Units(0)) .into(), - Text::new(shape.to_string()) + Text::new(i18n.get_msg(Self::map_kind_key(shape))) .width(Length::FillPortion(95)) .size(fonts.cyri.scale(14)) .vertical_alignment(iced::VerticalAlignment::Center) @@ -667,4 +667,11 @@ impl Screen { all.into() } } + + fn map_kind_key(map_kind: MapKind) -> &'static str { + match map_kind { + MapKind::Circle => "main-singleplayer-map_shape-circle", + MapKind::Square => "main-singleplayer-map_shape-square", + } + } }