Hi there. I'm one of the authors for an addon called lightwell buddy.
It's recently come to my attention that the addon doesn't work well outside of of english locales (big surprise eh?)... but not in ways I expected. I use the spellid's instead of spell names, and all that basic stuff.
Instead it's failing from similar, but more subtle pitfalls. For example, the addon is designed to allow players to enter the names of people they want to deliver personal messages to. I made this function to properly format the names, remove spaces, and if extra words were present, format them like a server name.
PHP Code:
function LWB:FormatName(name)
local f = ""
local c = 1
for w in string.gmatch(name, "%a+") do
if w then w = strupper(strsub(w,1,1))..strlower(strsub(w,2)) end
if c == 1 and w then
f = w
elseif c == 2 and w then
f = f.."-"..w
elseif w then
f = f.." "..w
end
c = c + 1
end
return f
end
Now, apparently this function is not treating ... what would you call them... "non-standard latin characters" like normal text, and is discarding them, or rather even splitting up the text between each non-standard character it finds, so håppy would become H-ppy. I can figure a way to work around this in this particular scenario I'm sure, but my main concern is I don't know where else I might be having issues. For example, do other locals even separate the name and server of each player with a hyphen? Does capitalization or lower case even exist in other locales, and if so, will it cause an issue treating foreign text to functions like strupper()? Are there resources available for me to look into to learn about the issues, and best practices to avoid them?
In general, I'm not too concerned (yet) with making every button, message and tooltip appear in the localized language. That seems easy enough to do if I really wanted... I just want to make sure it FUNCTIONS properly in different locales - without having the benefit of being able to test is there myself.
Thanks for your help.
-noob programmer.