Working on translation context
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user