Merge branch 'coffee-compiler/localize_item_amount' into 'master'

Localize item amount

See merge request veloren/veloren!4534
This commit is contained in:
Marcel 2024-07-27 21:51:09 +00:00
commit e70a0f3132
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)