How to update visible dialogue to language changes
Posted: Wed Feb 01, 2023 12:00 pm
In my project, which uses i2 for localization, it is possible to change the language in the settings while a dialogue is diaplayed. We see both the actor name and the dialogue text. Translation works fine when a new conversation is started, but is there any way i could force a refresh that would take new language change into account?
I noticed that simply calling SetLanguage on the DialogueManager did nothing, so I added an event that will be received in the code where I handle the DialogueSystem Api.
I believe I need a one-liner for this. Please let me know what I can do.
Code: Select all
LocalizationManager.CurrentLanguage = selectedLanguage;
string languageCode = LocalizationManager.CurrentLanguageCode;
DialogueManager.Instance.SetLanguage (languageCode);
OnLanguageChanged?.Invoke (selectedLanguage, languageCode);
I believe I need a one-liner for this. Please let me know what I can do.