You create a set of default string variables
Code:
local Message1 = "Message 1"
local Message2 = "Message 2"
if GetLocale() == "deDE" then
Message1 = "Germane for Message 1"
Message2 = "Germane for Message 2"
end
This is essentially the same as:
Code:
local Message1
local Message2
if GetLocale() == "deDE" then
Message1 = "German for Message 1"
Message2 = "German for Message 2"
else
Message1 = "Message 1"
Message2 - "Message 2"
end
-- you know it's German because GetLocale returns "deDE" if the game is running on a german client so you take it on good faith and feedback that it will work
. That or have VMs with the various language OSs installed
.
So now:
xx:SetText(Message1) will display "German for Message 1" on a german client otherwise "Message 1".
These variables can be created simply like I did here or in a table like I did in my original and if your addon spans multiple .lua files would most likely be created in the addons private table