As far as I know there is no way to get point of interest (POI) names in different language without reloading UI. It means that you will need to create some table with localized names in your addon.
How to get POI names for the current map in the current language:
Lua Code:
local zoneIndex = GetCurrentMapZoneIndex()
for poiIndex = 1, GetNumPOIs(zoneIndex) do
local name, level, startDesc, finishedDesc = GetPOIInfo(zoneIndex, poiIndex)
d(name)
end
Or just take a look to the
Undiscovered addon files (Language\UndiscoveredData-??.lua).
How to switch between laguages:
In my private addon I have defined three slash commands to switch language:
Lua Code:
SLASH_COMMANDS["/langen"] = function() SetCVar("language.2", "en") end
SLASH_COMMANDS["/langde"] = function() SetCVar("language.2", "de") end
SLASH_COMMANDS["/langfr"] = function() SetCVar("language.2", "fr") end
Where you want to display modified names? You can for example modify tooltip creators for POI pins on the world map:
Lua Code:
local mt = {}
function mt.__call(self, zoneIndex, poiIndex)
local name
if self[zoneIndex] then
name = self[zoneIndex][poiIndex]
end
return name
end
local englishPOINames = setmetatable({}, mt)
englishPOINames[17] = { --example for Alik'r Desert
[1] = "Sentinel Docks",
[2] = "Ancestor's Landing",
[3] = "Rain Catcher Fields",
[4] = "Morwha's Bounty",
[5] = "Tu'whacca's Throne",
[6] = "Kulati Mines",
[7] = "Leki's Blade",
[8] = "Sep's Spine",
[9] = "Bergama",
[10] = "Tava's Blessing",
[11] = "HoonDing's Watch",
[12] = "Satakalaam",
[13] = "Kozanset",
[14] = "Sentinel",
[15] = "Salas En",
[16] = "Motalion Necropolis",
[17] = "Morwha's Bounty Wayshrine",
[18] = "Sentinel Wayshrine",
[19] = "Bergama Wayshrine",
[20] = "Leki's Blade Wayshrine",
[21] = "Satakalaam Wayshrine",
[22] = "Santaki",
[23] = "Divad's Chagrin Mine",
[24] = "Aldunz",
[25] = "Coldrock Diggings",
[26] = "Sandblown Mine",
[27] = "Yldzuun",
[28] = "Lost City of the Na-Totambu",
[29] = "Divad's Chagrin Mine Wayshrine",
[30] = "Kulati Mines Wayshrine",
[31] = "Aswala Stables Wayshrine",
[32] = "Sep's Spine Wayshrine",
[33] = "Ogre's Bluff",
[34] = "Shrikes' Aerie Wayshrine",
[35] = "HoonDing's Watch Wayshrine",
[36] = "Myrkwasa Dolmen",
[37] = "Hollow Waste Dolmen",
[38] = "Tigonus Dolmen",
[39] = "The Warrior",
[40] = "The Ritual",
[41] = "The Thief",
[42] = "Dungeon: Volenfell",
[43] = "Goat's Head Oasis Wayshrine",
[44] = "Lost Caravan",
[45] = "Lesser Circle",
[46] = "Giant Camp",
[47] = "Forsaken Hearts Cave",
[48] = "Hag Camp",
[49] = "King's Rest",
[50] = "Saltwalker Militia Camp",
[51] = "Aswala's Remembrance",
[52] = "Tears of the Dishonored",
[53] = "Ragnthar",
[54] = "Rkulftzel",
[55] = "Alezer Kotu",
[56] = "Easterly Aerie",
[57] = "Hatiha's Camp",
[58] = "Na-Totambu's Landing",
[59] = "Artisan's Oasis",
[60] = "Duneripper Downs",
[61] = "Wayfarer's Wharf",
}
local function AddEnglishName(pin)
local poiIndex = pin:GetPOIIndex()
local zoneIndex = pin:GetPOIZoneIndex()
local englishName = englishPOINames(zoneIndex, poiIndex)
if not englishName then return end
local localizedName = ZO_WorldMapMouseoverName:GetText()
ZO_WorldMapMouseoverName:SetText(localizedName .. " (" .. englishName .. ")")
end
local CreatorPOISeen = ZO_MapPin.TOOLTIP_CREATORS[MAP_PIN_TYPE_POI_SEEN].creator
ZO_MapPin.TOOLTIP_CREATORS[MAP_PIN_TYPE_POI_SEEN].creator = function(pin)
CreatorPOISeen(pin) --original tooltip creator
AddEnglishName(pin) --your function that will change text
end
local CreatorPOIComplete = ZO_MapPin.TOOLTIP_CREATORS[MAP_PIN_TYPE_POI_COMPLETE].creator
ZO_MapPin.TOOLTIP_CREATORS[MAP_PIN_TYPE_POI_COMPLETE].creator = function(pin)
CreatorPOIComplete(pin) --original tooltip creator
AddEnglishName(pin) --your function that will change text
end