From 009ca07303158e60c82661838833651ca981615d Mon Sep 17 00:00:00 2001 From: coffee-compiler <22056268-coffee-compiler@users.noreply.gitlab.com> Date: Sat, 27 Jul 2024 21:51:09 +0000 Subject: [PATCH] Localize item amount --- assets/voxygen/i18n/en/item/common.ftl | 1 + voxygen/src/ui/widgets/item_tooltip.rs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 assets/voxygen/i18n/en/item/common.ftl diff --git a/assets/voxygen/i18n/en/item/common.ftl b/assets/voxygen/i18n/en/item/common.ftl new file mode 100644 index 0000000000..334ed2677e --- /dev/null +++ b/assets/voxygen/i18n/en/item/common.ftl @@ -0,0 +1 @@ +items-common-amount = Amount: { $amount } \ No newline at end of file diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index ac640d3553..8bb91fe871 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -577,9 +577,14 @@ impl<'a> Widget for ItemTooltip<'a> { .color(quality) .set(state.ids.title, ui); + let amount = i18n.get_msg_ctx( + "items-common-amount", + &i18n::fluent_args! { "amount" => self.item.amount().get() }, + ); + // Amount let (subtitle_relative_id, spacing) = if self.item.amount().get() > 1 { - widget::Text::new(&format!("Amount: {}", self.item.amount().get())) + widget::Text::new(&amount) .w(title_w) .graphics_for(id) .parent(id)