WoWInterface (
-   AddOn Help/Support (
-   -   Get unit locale (

Marsgames 02-11-17 10:40 AM

Get unit locale

Is there a way to know the client locale of my target (enUS, deDE, frFR...) ?


p3lim 02-11-17 11:20 AM

For your client you can use GetLocale().
For your target (or any unit) you could match their realm against the ones available. The list would map their realm name to their locale.
I think I saw a library doing something like that around.


Marsgames 02-11-17 12:08 PM

Thank you very much. Have to learn how it works and it will be perfect :)

pas06 02-11-17 01:51 PM

Maybe this addon is what you are looking for:

Marsgames 02-11-17 02:59 PM

Thank you all, thanks to you I succed to do what I wanted :)

SDPhantom 02-11-17 07:31 PM

Locale from server name isn't a reliable process as many regions can have players of different locales. This means any one server can have multiple locales of players playing it and since the server doesn't care what locale a game client is in, it's not something that'll ever be made available to us.

Marsgames 02-12-17 04:58 AM

Yes, I think, but in fact I just wanted to send a message in the right language, so it's ok for me, I hope if someone play on german or english server, he knows how to speak german or english :)

SDPhantom 02-13-17 10:00 AM

Unfortunately, without the same addon running on both sides, there's no way to get another player's locale. The servers were set up in a way in which this matter is irrelevant and are grouped by location instead as indicated by your region. As mentioned earlier, there are libraries that give you a likely scenario based on server name, but this is based on what percentage of a server's population is of a specific locale from census data collected provided from users themselves. Also, other players can be multilingual, so you can try in whatever languages you feel comfortable conversing in. There's no harm in it.

All times are GMT -6. The time now is 05:43 PM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI