Hello,
I just localized one of my addon using this:
localization.lua
Code:
local addonName, L = ...;
local function defaultFunc(L, key)
return key;
end
setmetatable(L, {__index=defaultFunc});
myAddon.lua
Code:
local _, L = ...;
...
print(L["Hello World!"]);
It works fine for all strings located in myAddon.lua file but I don't understand what I have to modify if I want to use
Code:
print(L["Hello World!"]);
in the .xml file (for example, to localize button's name)?
If I well understood variable's scope, there are only 2 possibilities :
- variable used in a single .lua file
- variable used in all of the loaded addons
But there is no simple way to declare variable usable for one addon, right?
Thanks for your help.