Skip to content

Support short item descriptions - #291

Merged
SmallJoker merged 2 commits into
minetest-mods:masterfrom
OgelGames:short_desc
Aug 8, 2026
Merged

SmallJoker merged 2 commits into
minetest-mods:masterfrom
OgelGames:short_desc

Conversation

@OgelGames

@OgelGames OgelGames commented Aug 5, 2026 •

Copy link
Copy Markdown

Changes the item description HUD display code to support short descriptions, including those set in metadata.

Comment thread item_names.lua
data.index = index
data.dtime = 0
local lang_code = core.get_player_information(player:get_player_name()).lang_code
local lang_code = core.get_player_information(name).lang_code

@SmallJoker SmallJoker Aug 5, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: cache this.
Note to myself: make the "Only names" feature per-player configurable.

@SmallJoker SmallJoker left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works. Thanks.
Unfortunately, get_short_description is not prefect either. luanti-org/luanti#12566. This could be circumvented by first translating the description and then trimming it to the first line.

Will merge in a few days unless you'd like to make adjustments or there are objections.

@OgelGames

Copy link
Copy Markdown
Author

The consensus in that issue is for mods to avoid multi-line translations, but since we are already translating the description it makes sense to avoid breaking it anyway.

@SmallJoker

Copy link
Copy Markdown
Member

Thanks. Looks good.

@SmallJoker
SmallJoker merged commit 7c6ddd3 into minetest-mods:master Aug 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants