Originally Posted by circonian
I know you can create custom stingIds like this:
Lua Code:
ZO_CreateStringId("STRING_JEWELRY", "Jewelry")
But if you get translations how do you (if you can) add the translations to the same StringId so that when you call
Lua Code:
GetString(STRING_JEWELRY)
It comes out in the right language?
|
You have to create different .lua for each language and the load the correct one using the $(language) variable in addon manifest.
addon.txt:
Code:
## Title: My Addon
## Version: 1.0
## Author: Garkin
## APIVersion: 100008
Lang/$(language).lua
addon.lua
Lang/en.lua:
Lua Code:
ZO_CreateStringId("STRING_JEWELRY", "Jewelry")
Lang/de.lua:
Lua Code:
ZO_CreateStringId("STRING_JEWELRY", "Schmuck")
Lang/fr.lua:
Lua Code:
ZO_CreateStringId("STRING_JEWELRY", "Bijoux")
addon.lua:
Lua Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_PLAYER_ACTIVATED, function(event)
d(GetString(STRING_JEWELRY))
EVENT_MANAGER:UnregisterForEvent("MyAddon", event)
end)