Localize item amount

This commit is contained in:
coffee-compiler 2024-07-27 21:51:09 +00:00 committed by Marcel
parent 127c0ce0aa
commit 009ca07303
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1 @@
items-common-amount = Amount: { $amount }

View File

@ -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)