Thread Tools Display Modes
05-27-18, 02:09 PM   #1
abigale
A Murloc Raider
Join Date: May 2018
Posts: 5
Changing client locale for ONLY yell purposes

I raid with people that play on US but are from another country and I'm trying to trick the getlocale to appear in another language versus english.

I need to do so that the client stays in english (as i'm american) but it pulls another locale so that the addons yell in-game in the language I need.

I tried using
Code:
local GetLocale_Old = GetLocale();

function GetLocale()
	return "ruRU";
end
And setting it in addons but that only changed the display text of verious addons such as Skada, Details, and WorldQuestFinder - it did not change any addons with yell privileges, such as interrupter nor dbm.

Thanks in advance for any help.

Last edited by abigale : 05-27-18 at 02:13 PM.
  Reply With Quote
05-27-18, 02:21 PM   #2
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Your addon needs to load *before* DBM if you want to change the locale it uses.

Only ways I know to do that are to mess with your addon name to try to get it to load early, or (better) to set an optional dependency on DBM for your addon - but, you won't be able to distribute that.
  Reply With Quote
05-27-18, 02:36 PM   #3
abigale
A Murloc Raider
Join Date: May 2018
Posts: 5
Originally Posted by sylvanaar View Post
Your addon needs to load *before* DBM if you want to change the locale it uses.

Only ways I know to do that are to mess with your addon name to try to get it to load early, or (better) to set an optional dependency on DBM for your addon - but, you won't be able to distribute that.
How would I get it to achieve that? Do they have a load sequence?

It's named !Language, which places it in the beginning of the addons folder - before DBM.
  Reply With Quote
05-27-18, 03:29 PM   #4
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Edit DBM's TOC and add this line

Code:
## OptionalDeps: !Language
  Reply With Quote
05-27-18, 03:57 PM   #5
abigale
A Murloc Raider
Join Date: May 2018
Posts: 5
Originally Posted by sylvanaar View Post
Edit DBM's TOC and add this line

Code:
## OptionalDeps: !Language
Before adding OptionalDeps, my existing addon changed all of my fonts within DBM to Russian, which is OK because I can visibly see what I need to prepare for.

After adding OptionalDeps, nothing changed really other than it broke some announcements within DBM on my side, changing letters to ?'s.

As for the purpose of this, which is for it to change the language which it automatically yells my debuffs to the raid in Russian (what I'm trying to do), it is still yelling in English. Adding that line didn't change the language which it yells to the raid in.
  Reply With Quote
05-27-18, 04:09 PM   #6
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Curious, but which raid are you testing this on?
If this is for Antorus, the latest DVM SVN (r17568) does not have russian localization included for it, unless I'm missing something? (DBM-AntorusBurningThrone\localization.ru.lua does not exist, and I don't see anything for it in any other localization files.)

If this is for another raid that does have russian localization then ignore.

Last edited by Ammako : 05-27-18 at 04:11 PM.
  Reply With Quote
05-27-18, 04:53 PM   #7
abigale
A Murloc Raider
Join Date: May 2018
Posts: 5
Originally Posted by Ammako View Post
Curious, but which raid are you testing this on?
If this is for Antorus, the latest DVM SVN (r17568) does not have russian localization included for it, unless I'm missing something? (DBM-AntorusBurningThrone\localization.ru.lua does not exist, and I don't see anything for it in any other localization files.)

If this is for another raid that does have russian localization then ignore.
The purpose is for ToS carries right now, eventually for Antorus, but I did test it in Antorus. You're right, they don't have RU so I changed the return "ruRU" to "koKR" just to see if it worked. Now that I'm thinking about it, that's probably why the event came back as ?'s.

Additionally, I changed the TOC on another addon, an interrupt announcer (AnnounceInterrupts), which I tried RU and KR and still had the same issue of it yelling in English.

Wanted to test different variables before coming back and saying it didn't work.
  Reply With Quote
05-27-18, 05:14 PM   #8
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
If anything, what you're doing is fairly niche and you aren't going to be distributing this addon anyway, only using it for your own personal use. So you can probably get away with using cheap hacks.

I don't know why your current method you are attempting does not work, and I probably wouldn't be able to help with that specific one, but it does seem like AnnounceInterrupts has a Russian locale. What if you opened both the enUS and the ruRU locale files and replaced the relevant English localization strings with the Russian ones? Cheap, but it would force your English client to output Russian in /y for this addon (though it would be annoying to turn off/revert whenever you needed to go back to yelling in English.)
As long as enUS client would be able to handle outputting Cyrillic in chat on its own it should do the trick, I'd imagine.

Has your raid group been successfully outputting DBM announcements in Russian? Because if the official download doesn't seem to have Russian locale it's always possible they have their own unofficial translation somewhere. It's also possible that I'm completely wrong and that the Russian locale exists somewhere in the code and I simply missed it.

Also I believe there may potentially be an issue where spell and enemy names may show up in English on your /y announcement messages, I'm not sure if overriding GetLocale could trick the client into giving the addon Russian-localized names. So for example you'd be yelling something like "Прервал Pangs of Guilt у Belac" in chat which may not be all that helpful if your teammates can only read Russian.

Last edited by Ammako : 05-27-18 at 05:19 PM.
  Reply With Quote
05-27-18, 05:44 PM   #9
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Ammako has a good point - if you are looking for "Such and Such Debuff Name" countdowns or something - then you will be out of luck, because those are based on the spell ID description which is based on your client localization.

I wonder if locale is actually built into the client - or if it gets it from the system. For fun, try changing your language in your OS
  Reply With Quote
05-27-18, 05:54 PM   #10
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Locale is client locale, you can change it in the game's options on the battle.net client and it downloads the selected language if it wasn't already selected; though as far as I know, external modifications may be required to load servers in unsupported languages.
Not sure if NA has any restrictions of the sort, though. I know a lot of people play on NA using Korean or Chinese language or even French, the latter by simply downloading the French language pack for the client, and they seem to be doing fine, but I couldn't load Russian servers on EU unless the client was set to Russian locale.
  Reply With Quote
05-27-18, 06:32 PM   #11
abigale
A Murloc Raider
Join Date: May 2018
Posts: 5
Originally Posted by Ammako View Post
If anything, what you're doing is fairly niche and you aren't going to be distributing this addon anyway, only using it for your own personal use. So you can probably get away with using cheap hacks.

I don't know why your current method you are attempting does not work, and I probably wouldn't be able to help with that specific one, but it does seem like AnnounceInterrupts has a Russian locale. What if you opened both the enUS and the ruRU locale files and replaced the relevant English localization strings with the Russian ones? Cheap, but it would force your English client to output Russian in /y for this addon (though it would be annoying to turn off/revert whenever you needed to go back to yelling in English.)
As long as enUS client would be able to handle outputting Cyrillic in chat on its own it should do the trick, I'd imagine.

Has your raid group been successfully outputting DBM announcements in Russian? Because if the official download doesn't seem to have Russian locale it's always possible they have their own unofficial translation somewhere. It's also possible that I'm completely wrong and that the Russian locale exists somewhere in the code and I simply missed it.

Also I believe there may potentially be an issue where spell and enemy names may show up in English on your /y announcement messages, I'm not sure if overriding GetLocale could trick the client into giving the addon Russian-localized names. So for example you'd be yelling something like "Прервал Pangs of Guilt у Belac" in chat which may not be all that helpful if your teammates can only read Russian.
Yea, only for me for right now.

AnnounceInterrupts does have a locale RU but it's not toggling for whatever reason
I moreorless merged everything from the EN copy to the RU, very sloppily, just to see if I could get it to say ANYTHING in RU, but it wouldn't. Next I'll try being more delicate and move strings over. I don't really care about the interrupts, I was just using that addon as a test to see if I could get it to /y in Russian.

Yes to that too, we're working on submitting an official RU version. You're not wrong, RU locale does not exist for Antorus at this moment.

I imagine that it'll /y incorrect spells as well, but that's alright. One thing at a time, I need to get it to output Russian first, lol.

Thanks for all of the continued help.

Edit: After moving the strings from ruRU to enUS in Announceinterrupts, I got that to work as intended.
Going to eat some dinner and then try DBM again and see if I can get that to work too.
/ai had to be reinstalled via twitch to get the locale to act as I wanted it, I must've screwed something up before, lol.

Last edited by abigale : 05-27-18 at 07:18 PM.
  Reply With Quote
05-27-18, 07:36 PM   #12
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
It would require some work, but you could always hardcode a translation table for every important spell and enemy name you would encounter while raiding with them, and edit the addons' logic to detect when those names are being used and make it output their Russian translation instead.

Or (and that would likely be much easier) you could always change DBM and AnnounceInterrupts to use SendAddonMessage rather than SendChatMessage, then have a specially crafted addon running separately which would receive that message, translate the spell/enemy names according to that table, and then output the properly translated strings in /y

It's pretty dirty, but as long as it works and gives the desired results, that's all that matters. Wowhead has the localized names for everything in the game accessible, so you can get those from there if needed.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Changing client locale for ONLY yell purposes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off