Community Forum

tree name localized

Forum Overview >> Scripting

CategoryScripting
Created23.01.2017 12:37


Fabio Celsa (fcelsa) 23.01.2017 12:45
Is possible to have in Lua script a localized name of wood tree with g_i18n:getText or other method ?
I tried with shape name like this, without success:
splitType = SplitUtil.splitTypes[getSplitType(shape)];
local nameOfTree = g_i18n:getText(splitType.name)

Thanks,
fcelsa

Tykonket (Unknown) 01.02.2017 17:57
This is the l10n_en.xml of FS17, searches if there is what you need.
http://pastebin.com/ymAntHm5

Fabio Celsa (fcelsa) 03.02.2017 19:06
Thanks, I appreciate your help, but not string of interesting in the file, I will need some other experiment... meanwhile if anyone know more, please tell all of us! :)



Tykonket (Unknown) 07.02.2017 10:22
Ok, so if you want add your own localized texts you only need to do this:
1) Add the section "l10n" in your modDesc.xml (<l10n></l10n>)
2) Add your onw "key" inside the "l10n" section (<text name="YOUR_KEY"></text>)
3) Add localized "texts" inside your key tag (<en>This is my onw key</en><it>Questa รจ la mia chiave</it>)
4) Call g_i18n inside your script (g_i18n:getText("YOUR_KEY"))
This is one of my projects that uses this practice
https://github.com/TyKonKet/FS17_CreatorTools/blob/master/src/modDesc.xml


Note: Log in to post. Create a new account here.