Originally Posted by tyroneexe
are we talking
Lua Code:
{ Icon="Interface\\Icons\\Ability_rogue_sprint"; Tooltip="Amphitheater of Annihilation(AoA)"; Message={ "Amphitheater of Annihilation(AoA) - EVENT:STADIUM RACING - Block the entrance!","INSTANCE_CHAT"; "AoA AoA GO NOW! - Block the entrance!","RAID_WARNING";} if GetLocale() == "deDE" then Message={ "CHATMESSAGE_DE ","INSTANCE_CHAT"; "RAIDMESSAGE_DE ","RAID_WARNING";}; Emote="FOLLOW"; };
and how do you test without a deDE client. Well at least I know some Germans
|
Close, but not quite. You can't put an
IF block in the middle of a table constructor. What most people do to handle localization is make a completely separate table that stores localized strings. Since localization can take up a lot of code, it's common to place it in a separate Lua file.
For this specifically, I'd put the entire layout table in an
IF block and make copies of localized versions for each locale check.
Lua Code:
local ButtonData;-- Data prototype
if GetLocale()=="deDE" then
ButtonData={
-- deDE Layout
};
elseif GetLocale()=="frFR" then
ButtonData={
-- frFR Layout
};
else-- Default enUS
ButtonData={
-- enUS Layout
};
end
To force it to load a specific locale, you could temporarily modify the condition statement you want to load to evaluate to
true. Adding
or true to it should do the trick.
PS: I forgot I had the "Show only in Ashran" code disabled for testing. This has been fixed in my previous post.