Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit bf9066a

Browse files
committed
Use get_short_description
1 parent a6a42b5 commit bf9066a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

init.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,19 +603,18 @@ local function snip(str, limit)
603603
return #str > limit and sprintf("%s...", sub(str, 1, limit - 3)) or str
604604
end
605605

606-
local function get_desc(item, lang_code)
606+
local function get_desc(item)
607607
if sub(item, 1, 1) == "_" then
608608
item = sub(item, 2)
609609
end
610610

611611
local def = reg_items[item]
612612

613613
if def then
614-
local desc = def.description
615-
desc = lang_code and translate(lang_code, desc) or desc
614+
local desc = ItemStack(item):get_short_description()
616615

617616
if true_str(desc) then
618-
desc = desc:trim():match("[^\n]*")
617+
desc = desc:trim()
619618

620619
if not find(desc, "%u") then
621620
desc = toupper(desc)
@@ -1490,7 +1489,7 @@ local function get_header(fs, data)
14901489
end
14911490

14921491
local desc_lim, name_lim = 32, 34
1493-
local desc = ESC(get_desc(data.query_item, data.lang_code))
1492+
local desc = ESC(get_desc(data.query_item))
14941493
local tech_name = data.query_item
14951494
local X = data.xoffset + 1.05
14961495
local Y1 = data.yoffset + 0.47

0 commit comments

Comments
 (0)