Custom item/entity translations
Posted: Sat May 28, 2016 2:53 pm
It would be nice if I could define in the prototype how an Entity/Item should be called in game without specifying a translation for the data.name key.
Example:
It would be nice if I could configure a function that resolves the name.
So I only have to provide two translations "mytree.naming-template" (__2__ __1__) and "mytree.sapling" (Sapling) for the result "Tree 2 Sapling").
(This is also intended as a help for MK2-MK100 translations that only differ in the number and are a pain to maintain for different languages.)
Why I want this?
Well because I don't want to maintain translations for other (mod added) trees as well that would be all build in the same way. "Tree 9 Sapling", "Rubber Tree Sapling", "Dessert tree Sapling"....
------------------------------------------------
Or that I can provide a reference to a translation to be used.
Maing "tree-02-small" using the same translations as "tree-02".
Why I want this:
Because in some cases, I have quite a lot different versions of the same thing and I don't want to maintain a translation for each of them.
(It does not matter if the tree is small or big, the only important thing is the name and maybe that the tree is not mature yet/is still growing)
Example:
Code: Select all
tree_type = data.raw["tree"]["tree-02"]
tree_item = {
type = "item",
name = tree_type.name .. "-sapling",
icon = tree_type.icon,
...
Code: Select all
localized_string("mytree.naming-template", localized_string("mytree.sapling"), localized_string("tree-02"))
(This is also intended as a help for MK2-MK100 translations that only differ in the number and are a pain to maintain for different languages.)
Why I want this?
Well because I don't want to maintain translations for other (mod added) trees as well that would be all build in the same way. "Tree 9 Sapling", "Rubber Tree Sapling", "Dessert tree Sapling"....
------------------------------------------------
Or that I can provide a reference to a translation to be used.
Code: Select all
type = "entity",
name = tree_type.name .. "-small",
localiced_name = tree_type.name,
icon = tree_type.icon,
...
Why I want this:
Because in some cases, I have quite a lot different versions of the same thing and I don't want to maintain a translation for each of them.
(It does not matter if the tree is small or big, the only important thing is the name and maybe that the tree is not mature yet/is still growing)