I'm making a multi-lingual app with the Dialogue System. I've added extra languages using the Template tab of the Dialogue System in the Unity editor. This is fine for changing the language of the dialogue, which you can do using the DialogueSystemController.SetLanguage method. But the ConversationState class (which stores the current conversation text) only contains text for the current language.
What I would like to do is to provide the ability to translate the text, which means I need access to all the different languages - not just the one that is set using the DialogueSystemController.SetLanguage method.
Any clue on how to set this up??? Thanks!
Live translations
Re: Live translations
Hi,
To get the default text and other language fields, use the ConversationState's subtitle.dialogueEntry property. Example using an OnConversationLine method:
To get the default text and other language fields, use the ConversationState's subtitle.dialogueEntry property. Example using an OnConversationLine method:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
DialogueEntry entry = DialogueManager.currentConversationState.subtitle.dialogueEntry;
Debug.Log("Original dialogue text: {entry.DialogueText}");
string spanishDialogueText = Field.LookupValue(entry.fields, "es");
string spanishMenuText = Field.LookupValue(entry.fields, "Menu Text es");
Debug.Log("Spanish dialogue text: {spanishDialogueText}");
Debug.Log("Spanish menu text: {spanishMenuText}");
}