I18n pickup-msg correction for en uk ru

This commit is contained in:
evgenkot 2024-02-12 22:01:39 +05:00
parent eee330c9e9
commit eb4911f60d
4 changed files with 79 additions and 68 deletions

View File

@ -81,13 +81,11 @@ hud-chat-chat_tab_hover_tooltip = Right click for settings
## HUD Pickup message
hud-loot-pickup-msg = { $is_you ->
[true] You picked up { $amount ->
[1] { $item }
*[other] {$amount}x {$item}
}
*[false] { $actor } picked up { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
hud-loot-pickup-msg-you = { $amount ->
[1] You picked up { $item }
*[other] You picked up {$amount}x {$item}
}
hud-loot-pickup-msg = { $amount ->
[1] { $actor } picked up { $item }
*[other] { $actor } picked up { $amount }x { $item }
}

View File

@ -53,24 +53,18 @@ hud-chat-default_death_msg = { "[" }{ $name }] умер
hud-chat-all = Все
hud-chat-chat_tab_hover_tooltip = ПКМ для настроек
hud-loot-pickup-msg = { $is_you ->
[true] Вы подобрали { $amount ->
[1] { $item }
*[other] {$amount}x {$item}
hud-loot-pickup-msg-you = { $amount ->
[1] Вы подобрали { $item }
*[other] Вы подобрали {$amount}x {$item}
}
hud-loot-pickup-msg = { $gender ->
[she] { $amount ->
[1] { $actor } подобрала { $item }
*[other] { $actor } подобрала { $amount }x { $item }
}
*[false] { $gender ->
[she] { $actor } подобрала { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
[he] { $actor } подобрал { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
*[other] { $actor } подняло { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
*[he] { $amount ->
[1] { $actor } подобрал { $item }
*[other] { $actor } подобрал { $amount }x { $item }
}
}
hud-chat-goodbye = До свидания!

View File

@ -163,23 +163,17 @@ hud-chat-chat_tab_hover_tooltip = Правий клік для налаштув
## HUD Pickup message
hud-loot-pickup-msg = { $is_you ->
[true] Ви підняли { $amount ->
[1] { $item }
*[other] {$amount}x {$item}
hud-loot-pickup-msg-you = { $amount ->
[1] Ви підняли { $item }
*[other] Ви підняли {$amount}x {$item}
}
hud-loot-pickup-msg = { $gender ->
[she] { $amount ->
[1] { $actor } підняла { $item }
*[other] { $actor } підняла { $amount }x { $item }
}
*[false] { $gender ->
[she] { $actor } підняла { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
[he] { $actor } підняв { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
*[other] { $actor } підняло { $amount ->
[1] { $item }
*[other] { $amount }x { $item }
}
*[he] { $amount ->
[1] { $actor } підняв { $item }
*[other] { $actor } підняв { $amount }x { $item }
}
}

View File

@ -355,18 +355,25 @@ impl<'a> Widget for LootScroller<'a> {
)
.set(state.ids.message_icons[i], ui);
let target_name = match self.client.player_list().get(taken_by) {
Some(info) => info.player_alias.clone(),
None => match self.client.state().ecs().entity_from_uid(*taken_by) {
Some(entity) => {
let stats = self.client.state().read_storage::<common::comp::Stats>();
stats
.get(entity)
.map_or(format!("<entity {}>", *taken_by), |e| e.name.to_owned())
let target_name = self
.client
.player_list()
.get(taken_by)
.map_or_else(
|| {
self.client
.state()
.ecs()
.entity_from_uid(*taken_by)
.and_then(|entity| {
let stats =
self.client.state().read_storage::<common::comp::Stats>();
stats.get(entity).map(|e| e.name.clone())
})
},
None => format!("<uid {}>", *taken_by),
},
};
|info| Some(info.player_alias.clone()),
)
.unwrap_or_else(|| format!("<uid {}>", *taken_by));
let (user_gender, is_you) = match self.client.player_list().get(taken_by) {
Some(player_info) => match player_info.character.as_ref() {
@ -383,20 +390,38 @@ impl<'a> Widget for LootScroller<'a> {
None => ("??".to_string(), false),
};
let label = self.localized_strings.get_msg_ctx(
"hud-loot-pickup-msg",
&i18n::fluent_args! {
"is_you" => is_you.to_string(),
"gender" => user_gender,
"actor" => target_name,
"amount" => amount,
"item" => {
let (name, _) =
util::item_text(&item, self.localized_strings, self.item_i18n);
name
},
},
);
let label = match is_you {
true => {
self.localized_strings.get_msg_ctx(
"hud-loot-pickup-msg-you",
&i18n::fluent_args! {
"gender" => user_gender,
"amount" => amount,
"item" => {
let (name, _) =
util::item_text(&item, self.localized_strings, self.item_i18n);
name
},
},
)
}
false => {
self.localized_strings.get_msg_ctx(
"hud-loot-pickup-msg",
&i18n::fluent_args! {
"gender" => user_gender,
"actor" => target_name,
"amount" => amount,
"item" => {
let (name, _) =
util::item_text(&item, self.localized_strings, self.item_i18n);
name
},
},
)
}
};
let label_font_size = 20;
Text::new(&label)