• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore Gossip Menu text in multiple languages

damiansp15

Emulation Addict
hello, guys i have a little problem i want to make my custom script with Gossip menus in at least 2 languages, i read.

Code:
Uses gossip item info from DB
AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action);
but i dont know how to do it maybe someone know how and can help me to do this
i want to translate in 2 languages something like this for example
Code:
                AddGossipItemFor(player, 0, "|TInterface\\icons\\Spell_Nature_Regenerate:40:40:-14|t Restaurar Vida y Mana", GOSSIP_SENDER_MAIN, 1);		
		AddGossipItemFor(player, 0, "|TInterface\\icons\\SPELL_HOLY_BORROWEDTIME:40:40:-14|t Resetar Cooldowns", GOSSIP_SENDER_MAIN, 2);			
		AddGossipItemFor(player, 0, "|TInterface\\icons\\Achievement_BG_AB_defendflags:40:40:-14|t Quitar Bug de Combate", GOSSIP_SENDER_MAIN, 3);	
		AddGossipItemFor(player, 0, "|TInterface\\icons\\Achievement_BG_winAB_underXminutes:40:40:-14|t Resetar Instancias", GOSSIP_SENDER_MAIN, 4);
 
Last edited:

Rochet2

Moderator / Eluna Dev
If you use the first code / function you posted, then you would use the menu_id and id columns from gossip_menu_option table as gossipMenuID and gossipMenuItemID.
Then the translations would be added to locales_gossip_menu_option with the same menu_id and id.

So all your gossip text would be in DB. English text in the normal gossip option table and translations in locales gossip option table.
 

damiansp15

Emulation Addict
thanks now i got it, but have other doubt. i can translate something like PSendSysMessage("|cffFFFF00bla bla bla"); //
or SendNotification("|cffFFFF00bla bla bla"); in other languages too or i cant because i have to much scripts
And I would like to have as many languages as possible> X
but i cant find nothing to do it >^ and sorry for respond 1 week later >p
 
Last edited:

Rochet2

Moderator / Eluna Dev
Im not quite sure what is the best way to translate random strings, but I used to use the DB table trinity_string and in c++ you can get the entry with char const* string = ChatHandler(player->GetSession()).GetTrinityString(LANG_YOUR_DEFINED_STRING_ID); and usually those definitions are in Languages.h
I think many methods like sendnotification and others are implemented so that you can just call player->GetSession()->SendNotification(LANG_YOUR_DEFINED_STRING_ID);
 
Top