Working on translation context

This commit is contained in:
2025-05-25 20:15:34 -05:00
parent 470fd62e2f
commit 44dd3b7aa6
8 changed files with 112 additions and 19 deletions

View File

@@ -19,8 +19,19 @@ enum Category {
FOOD
};
static func getCategoryTitleKey(cat:Category) -> String:
return "item.category." + str(cat).to_lower() + ".title"
@export var title:String = ""
@export var description_text:String = ""
@export var type:Type = Type.POTION
@export var category:Category = Category.INGREDIENT
@export var stackable:bool = true
func getTranslationContext() -> TransContext:
var ctx:TransContext = TransContext.new()
ctx.addTransPlural("title", title)
ctx.addTrans("description", description_text)
ctx.addTrans("category", getCategoryTitleKey(category))
ctx.addBool("stackable", stackable)
return ctx