View Single Post
05/01/23, 11:45 AM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
You can easily find out other language names too by switiching the language ingame via (merTorchbug updated installed!):
/tblang <2CharLang>

<2CharLang> can be:

de
en
es
fr
ru
zh --Chinese

/tblang en will bring you backt o English then.
Simple and nothing damaged,. Better disable all other addons though, only your 1 own you work on enabled + merTorchbug and helper tools like LibDebugLogger e.g.
Makes loading screen fast.

That way you can String see results of the same API functions and can copy the texts (you can use pChat e.g. to make right clicking chat entries -> copy line simple, or use DebugLogViewer so that messages of the API functions raised via /tb GetUnitZOne("player") or /script .... to that UI where you can copy them 1:1 from via mouse mark and CTRL+C

In your addon check for the current client language via:
local clientLang = GetCVar("language.2")

Will return something liek de, en, fr then.
And you can make your table multilanguage that way:
local deadZones = {
["en"] = {...},
["de"] = {...},
["fr"] = {...},
...
}

And access it via
local deadZonesToCheck = deadZones[clienLang] or deadZones["en"] --fallback language English

for i=1, #deadZonesToCheck, 1 do
if string.find(string.lower(stringToSearch), deadZonesToCheck[i], 1, true) ~= nil then
--found, either use break to exit the loop or return to exit the function
return true
end

Last edited by Baertram : 05/01/23 at 11:48 AM.
  Reply With Quote